@@ -31,30 +31,30 @@ discard block |
||
| 31 | 31 | * CHECK FOR OLD COMPATIBILITY PACKS AND DISABLE IF THEY ARE ACTIVE |
| 32 | 32 | */ |
| 33 | 33 | if (is_admin()) {
|
| 34 | - /** |
|
| 35 | - * Include WordPress core file so we can use core functions to check for active plugins. |
|
| 36 | - */ |
|
| 37 | - include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
| 34 | + /** |
|
| 35 | + * Include WordPress core file so we can use core functions to check for active plugins. |
|
| 36 | + */ |
|
| 37 | + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
| 38 | 38 | |
| 39 | - if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
|
|
| 40 | - deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
|
|
| 41 | - } |
|
| 39 | + if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
|
|
| 40 | + deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
|
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
|
|
| 44 | - deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
|
|
| 45 | - } |
|
| 43 | + if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
|
|
| 44 | + deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
|
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
|
|
| 48 | - deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
|
|
| 49 | - } |
|
| 47 | + if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
|
|
| 48 | + deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
|
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
|
|
| 52 | - deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
|
|
| 53 | - } |
|
| 51 | + if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
|
|
| 52 | + deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
|
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
|
|
| 56 | - deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
|
|
| 57 | - } |
|
| 55 | + if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
|
|
| 56 | + deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
|
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | } |
| 60 | 60 | |
@@ -130,19 +130,19 @@ discard block |
||
| 130 | 130 | * @package GeoDirectory |
| 131 | 131 | */ |
| 132 | 132 | function geodir_error_log($log){
|
| 133 | - /* |
|
| 133 | + /* |
|
| 134 | 134 | * A filter to override the WP_DEBUG setting for function geodir_error_log(). |
| 135 | 135 | * |
| 136 | 136 | * @since 1.5.7 |
| 137 | 137 | */ |
| 138 | - $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
| 139 | - if ( true === $should_log ) {
|
|
| 140 | - if ( is_array( $log ) || is_object( $log ) ) {
|
|
| 141 | - error_log( print_r( $log, true ) ); |
|
| 142 | - } else {
|
|
| 143 | - error_log( $log ); |
|
| 144 | - } |
|
| 145 | - } |
|
| 138 | + $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
| 139 | + if ( true === $should_log ) {
|
|
| 140 | + if ( is_array( $log ) || is_object( $log ) ) {
|
|
| 141 | + error_log( print_r( $log, true ) ); |
|
| 142 | + } else {
|
|
| 143 | + error_log( $log ); |
|
| 144 | + } |
|
| 145 | + } |
|
| 146 | 146 | } |
| 147 | 147 | /** |
| 148 | 148 | * Include all plugin functions. |
@@ -181,72 +181,72 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | if (is_admin() || defined( 'GD_TESTING_MODE' )) {
|
| 183 | 183 | |
| 184 | - /** |
|
| 185 | - * Include functions used in admin area only. |
|
| 186 | - * |
|
| 187 | - * @since 1.0.0 |
|
| 188 | - */ |
|
| 189 | - require_once('geodirectory-admin/admin_functions.php');
|
|
| 190 | - /** |
|
| 191 | - * Most actions/hooks used in admin area only are called from here. |
|
| 192 | - * |
|
| 193 | - * @since 1.6.11 |
|
| 194 | - */ |
|
| 195 | - require_once('geodirectory-admin/admin_dummy_data_functions.php');
|
|
| 196 | - /** |
|
| 197 | - * Most actions/hooks used in admin area only are called from here. |
|
| 198 | - * |
|
| 199 | - * @since 1.0.0 |
|
| 200 | - */ |
|
| 201 | - require_once('geodirectory-admin/admin_hooks_actions.php');
|
|
| 202 | - /** |
|
| 203 | - * Most admin JS and CSS is called from here. |
|
| 204 | - * |
|
| 205 | - * @since 1.0.0 |
|
| 206 | - */ |
|
| 207 | - require_once('geodirectory-admin/admin_template_tags.php');
|
|
| 208 | - /** |
|
| 209 | - * Include Google Analytics Class. |
|
| 210 | - * |
|
| 211 | - * @since 1.6.11 |
|
| 212 | - */ |
|
| 213 | - require_once('geodirectory-admin/class.analytics.stats.php');
|
|
| 214 | - /** |
|
| 215 | - * Include any functions needed for upgrades. |
|
| 216 | - * |
|
| 217 | - * @since 1.0.0 |
|
| 218 | - */ |
|
| 219 | - require_once(geodir_plugin_path() . '/upgrade.php'); |
|
| 220 | - if (get_option('geodir_installed') != 1) {
|
|
| 221 | - /** |
|
| 222 | - * Define language constants, here as they are not loaded yet. |
|
| 223 | - * |
|
| 224 | - * @since 1.0.0 |
|
| 225 | - */ |
|
| 226 | - require_once(geodir_plugin_path() . '/language.php'); |
|
| 227 | - /** |
|
| 228 | - * Include the plugin install file that sets up the databases and any options on first run. |
|
| 229 | - * |
|
| 230 | - * @since 1.0.0 |
|
| 231 | - */ |
|
| 232 | - require_once('geodirectory-admin/admin_install.php');
|
|
| 233 | - register_activation_hook(__FILE__, 'geodir_activation'); |
|
| 234 | - } |
|
| 235 | - register_deactivation_hook(__FILE__, 'geodir_deactivation'); |
|
| 236 | - |
|
| 237 | - /* |
|
| 184 | + /** |
|
| 185 | + * Include functions used in admin area only. |
|
| 186 | + * |
|
| 187 | + * @since 1.0.0 |
|
| 188 | + */ |
|
| 189 | + require_once('geodirectory-admin/admin_functions.php');
|
|
| 190 | + /** |
|
| 191 | + * Most actions/hooks used in admin area only are called from here. |
|
| 192 | + * |
|
| 193 | + * @since 1.6.11 |
|
| 194 | + */ |
|
| 195 | + require_once('geodirectory-admin/admin_dummy_data_functions.php');
|
|
| 196 | + /** |
|
| 197 | + * Most actions/hooks used in admin area only are called from here. |
|
| 198 | + * |
|
| 199 | + * @since 1.0.0 |
|
| 200 | + */ |
|
| 201 | + require_once('geodirectory-admin/admin_hooks_actions.php');
|
|
| 202 | + /** |
|
| 203 | + * Most admin JS and CSS is called from here. |
|
| 204 | + * |
|
| 205 | + * @since 1.0.0 |
|
| 206 | + */ |
|
| 207 | + require_once('geodirectory-admin/admin_template_tags.php');
|
|
| 208 | + /** |
|
| 209 | + * Include Google Analytics Class. |
|
| 210 | + * |
|
| 211 | + * @since 1.6.11 |
|
| 212 | + */ |
|
| 213 | + require_once('geodirectory-admin/class.analytics.stats.php');
|
|
| 214 | + /** |
|
| 215 | + * Include any functions needed for upgrades. |
|
| 216 | + * |
|
| 217 | + * @since 1.0.0 |
|
| 218 | + */ |
|
| 219 | + require_once(geodir_plugin_path() . '/upgrade.php'); |
|
| 220 | + if (get_option('geodir_installed') != 1) {
|
|
| 221 | + /** |
|
| 222 | + * Define language constants, here as they are not loaded yet. |
|
| 223 | + * |
|
| 224 | + * @since 1.0.0 |
|
| 225 | + */ |
|
| 226 | + require_once(geodir_plugin_path() . '/language.php'); |
|
| 227 | + /** |
|
| 228 | + * Include the plugin install file that sets up the databases and any options on first run. |
|
| 229 | + * |
|
| 230 | + * @since 1.0.0 |
|
| 231 | + */ |
|
| 232 | + require_once('geodirectory-admin/admin_install.php');
|
|
| 233 | + register_activation_hook(__FILE__, 'geodir_activation'); |
|
| 234 | + } |
|
| 235 | + register_deactivation_hook(__FILE__, 'geodir_deactivation'); |
|
| 236 | + |
|
| 237 | + /* |
|
| 238 | 238 | * Show a upgrade warning message if applicable. |
| 239 | 239 | * |
| 240 | 240 | * @since 1.5.6 |
| 241 | 241 | */ |
| 242 | - global $pagenow; |
|
| 242 | + global $pagenow; |
|
| 243 | 243 | if ( 'plugins.php' === $pagenow ) |
| 244 | - {
|
|
| 245 | - // Better update message |
|
| 246 | - $file = basename( __FILE__ ); |
|
| 247 | - $folder = basename( dirname( __FILE__ ) ); |
|
| 248 | - $hook = "in_plugin_update_message-{$folder}/{$file}";
|
|
| 249 | - add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 250 | - } |
|
| 244 | + {
|
|
| 245 | + // Better update message |
|
| 246 | + $file = basename( __FILE__ ); |
|
| 247 | + $folder = basename( dirname( __FILE__ ) ); |
|
| 248 | + $hook = "in_plugin_update_message-{$folder}/{$file}";
|
|
| 249 | + add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | 252 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function geodir_core_dequeue_script() |
| 24 | 24 | {
|
| 25 | - wp_dequeue_script('flexslider');
|
|
| 25 | + wp_dequeue_script('flexslider');
|
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
|
@@ -35,168 +35,168 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function geodir_templates_scripts() |
| 37 | 37 | {
|
| 38 | - $is_detail_page = false; |
|
| 39 | - $geodir_map_name = geodir_map_name(); |
|
| 38 | + $is_detail_page = false; |
|
| 39 | + $geodir_map_name = geodir_map_name(); |
|
| 40 | 40 | |
| 41 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 42 | - $is_detail_page = true; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - wp_enqueue_script('jquery');
|
|
| 46 | - |
|
| 47 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 48 | - wp_enqueue_script('geodirectory-script');
|
|
| 41 | + if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 42 | + $is_detail_page = true; |
|
| 43 | + } |
|
| 49 | 44 | |
| 50 | - $geodir_vars_data = array( |
|
| 51 | - 'siteurl' => get_option('siteurl'),
|
|
| 52 | - 'geodir_plugin_url' => geodir_plugin_url(), |
|
| 53 | - 'geodir_lazy_load' => get_option('geodir_lazy_load',1),
|
|
| 54 | - 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
| 55 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 56 | - 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
| 57 | - ); |
|
| 45 | + wp_enqueue_script('jquery');
|
|
| 46 | + |
|
| 47 | + wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 48 | + wp_enqueue_script('geodirectory-script');
|
|
| 49 | + |
|
| 50 | + $geodir_vars_data = array( |
|
| 51 | + 'siteurl' => get_option('siteurl'),
|
|
| 52 | + 'geodir_plugin_url' => geodir_plugin_url(), |
|
| 53 | + 'geodir_lazy_load' => get_option('geodir_lazy_load',1),
|
|
| 54 | + 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
| 55 | + 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 56 | + 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
| 57 | + ); |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
| 61 | + * |
|
| 62 | + * This is used by addons to add JS translatable variables. |
|
| 63 | + * |
|
| 64 | + * @since 1.4.4 |
|
| 65 | + * @param array $geodir_vars_data {
|
|
| 66 | + * geodir var data used by addons to add JS translatable variables. |
|
| 67 | + * |
|
| 68 | + * @type string $siteurl Site url. |
|
| 69 | + * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
| 70 | + * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
| 71 | + * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
| 72 | + * @type int $is_rtl Checks if current locale is RTL. |
|
| 73 | + * |
|
| 74 | + * } |
|
| 75 | + */ |
|
| 76 | + $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 77 | + |
|
| 78 | + wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
|
| 79 | + |
|
| 80 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 81 | + if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 82 | + |
|
| 83 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 84 | + wp_enqueue_script('geodirectory-lightbox-jquery');
|
|
| 85 | + |
|
| 86 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 87 | + if ($is_detail_page) {
|
|
| 88 | + wp_enqueue_script('geodirectory-jquery-simplemodal');
|
|
| 89 | + } |
|
| 58 | 90 | |
| 59 | - /** |
|
| 60 | - * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
| 61 | - * |
|
| 62 | - * This is used by addons to add JS translatable variables. |
|
| 63 | - * |
|
| 64 | - * @since 1.4.4 |
|
| 65 | - * @param array $geodir_vars_data {
|
|
| 66 | - * geodir var data used by addons to add JS translatable variables. |
|
| 67 | - * |
|
| 68 | - * @type string $siteurl Site url. |
|
| 69 | - * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
| 70 | - * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
| 71 | - * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
| 72 | - * @type int $is_rtl Checks if current locale is RTL. |
|
| 73 | - * |
|
| 74 | - * } |
|
| 75 | - */ |
|
| 76 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 77 | - |
|
| 78 | - wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
|
| 79 | - |
|
| 80 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 81 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 82 | - |
|
| 83 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 84 | - wp_enqueue_script('geodirectory-lightbox-jquery');
|
|
| 85 | - |
|
| 86 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 87 | - if ($is_detail_page) {
|
|
| 88 | - wp_enqueue_script('geodirectory-jquery-simplemodal');
|
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - if (in_array($geodir_map_name, array('auto', 'google'))) {
|
|
| 92 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 93 | - $map_key = "&key=" . geodir_get_map_api_key(); |
|
| 94 | - /** |
|
| 95 | - * Filter the variables that are added to the end of the google maps script call. |
|
| 96 | - * |
|
| 97 | - * This i used to change things like google maps language etc. |
|
| 98 | - * |
|
| 99 | - * @since 1.0.0 |
|
| 100 | - * @param string $var The string to filter, default is empty string. |
|
| 101 | - */ |
|
| 102 | - $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
| 103 | - wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
|
|
| 104 | - } |
|
| 91 | + if (in_array($geodir_map_name, array('auto', 'google'))) {
|
|
| 92 | + $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 93 | + $map_key = "&key=" . geodir_get_map_api_key(); |
|
| 94 | + /** |
|
| 95 | + * Filter the variables that are added to the end of the google maps script call. |
|
| 96 | + * |
|
| 97 | + * This i used to change things like google maps language etc. |
|
| 98 | + * |
|
| 99 | + * @since 1.0.0 |
|
| 100 | + * @param string $var The string to filter, default is empty string. |
|
| 101 | + */ |
|
| 102 | + $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
| 103 | + wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
|
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - if ($geodir_map_name == 'osm') {
|
|
| 107 | - // Leaflet OpenStreetMap |
|
| 108 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 109 | - wp_enqueue_style('geodirectory-leaflet-style');
|
|
| 106 | + if ($geodir_map_name == 'osm') {
|
|
| 107 | + // Leaflet OpenStreetMap |
|
| 108 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 109 | + wp_enqueue_style('geodirectory-leaflet-style');
|
|
| 110 | 110 | |
| 111 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 112 | - wp_enqueue_script('geodirectory-leaflet-script');
|
|
| 111 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 112 | + wp_enqueue_script('geodirectory-leaflet-script');
|
|
| 113 | 113 | |
| 114 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
|
|
| 115 | - wp_enqueue_script('geodirectory-leaflet-geo-script');
|
|
| 114 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
|
|
| 115 | + wp_enqueue_script('geodirectory-leaflet-geo-script');
|
|
| 116 | 116 | |
| 117 | - if ($is_detail_page) {
|
|
| 118 | - wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 119 | - wp_enqueue_style('geodirectory-leaflet-routing-style');
|
|
| 117 | + if ($is_detail_page) {
|
|
| 118 | + wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 119 | + wp_enqueue_style('geodirectory-leaflet-routing-style');
|
|
| 120 | 120 | |
| 121 | - wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
|
|
| 122 | - wp_enqueue_script('geodirectory-leaflet-routing-script');
|
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 121 | + wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
|
|
| 122 | + wp_enqueue_script('geodirectory-leaflet-routing-script');
|
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 126 | 126 | |
| 127 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 128 | - wp_enqueue_script('geodirectory-goMap-script');
|
|
| 129 | - |
|
| 130 | - |
|
| 131 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 132 | - wp_enqueue_script('chosen');
|
|
| 133 | - |
|
| 134 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 135 | - wp_enqueue_script('geodirectory-choose-ajax');
|
|
| 136 | - |
|
| 137 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 138 | - |
|
| 139 | - if (is_page() && geodir_is_page('add-listing')) {
|
|
| 140 | - // SCRIPT FOR UPLOAD |
|
| 141 | - wp_enqueue_script('plupload-all');
|
|
| 142 | - wp_enqueue_script('jquery-ui-sortable');
|
|
| 143 | - |
|
| 144 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 145 | - wp_enqueue_script('geodirectory-plupload-script');
|
|
| 146 | - // SCRIPT FOR UPLOAD END |
|
| 147 | - |
|
| 148 | - // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
|
| 149 | - if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 150 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 151 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 152 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 153 | - } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 154 | - $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
|
|
| 155 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 156 | - $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
|
|
| 157 | - } else {
|
|
| 158 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 159 | - } |
|
| 127 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 128 | + wp_enqueue_script('geodirectory-goMap-script');
|
|
| 129 | + |
|
| 130 | + |
|
| 131 | + wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 132 | + wp_enqueue_script('chosen');
|
|
| 133 | + |
|
| 134 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 135 | + wp_enqueue_script('geodirectory-choose-ajax');
|
|
| 136 | + |
|
| 137 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 138 | + |
|
| 139 | + if (is_page() && geodir_is_page('add-listing')) {
|
|
| 140 | + // SCRIPT FOR UPLOAD |
|
| 141 | + wp_enqueue_script('plupload-all');
|
|
| 142 | + wp_enqueue_script('jquery-ui-sortable');
|
|
| 143 | + |
|
| 144 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 145 | + wp_enqueue_script('geodirectory-plupload-script');
|
|
| 146 | + // SCRIPT FOR UPLOAD END |
|
| 147 | + |
|
| 148 | + // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
|
| 149 | + if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 150 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 151 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 152 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 153 | + } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 154 | + $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
|
|
| 155 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 156 | + $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
|
|
| 157 | + } else {
|
|
| 158 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 159 | + } |
|
| 160 | 160 | |
| 161 | - // place js config array for plupload |
|
| 162 | - $plupload_init = array( |
|
| 163 | - 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
| 164 | - 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
| 165 | - 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
| 166 | - 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
| 167 | - 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
| 168 | - 'multiple_queues' => true, |
|
| 169 | - 'max_file_size' => geodir_max_upload_size(), |
|
| 170 | - 'url' => $ajax_url, |
|
| 171 | - 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
| 172 | - 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
| 173 | - 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
|
|
| 174 | - 'multipart' => true, |
|
| 175 | - 'urlstream_upload' => true, |
|
| 176 | - 'multi_selection' => false, // will be added per uploader |
|
| 177 | - // additional post data to send to our ajax hook |
|
| 178 | - 'multipart_params' => array( |
|
| 179 | - '_ajax_nonce' => "", // will be added per uploader |
|
| 180 | - 'action' => 'plupload_action', // the ajax action name |
|
| 181 | - 'imgid' => 0 // will be added per uploader |
|
| 182 | - ) |
|
| 183 | - ); |
|
| 184 | - $base_plupload_config = json_encode($plupload_init); |
|
| 185 | - |
|
| 186 | - $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
|
|
| 187 | - 'upload_img_size' => geodir_max_upload_size()); |
|
| 188 | - |
|
| 189 | - wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
| 190 | - |
|
| 191 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 192 | - } // End if for add place page |
|
| 193 | - |
|
| 194 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 195 | - if ($is_detail_page) {
|
|
| 161 | + // place js config array for plupload |
|
| 162 | + $plupload_init = array( |
|
| 163 | + 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
| 164 | + 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
| 165 | + 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
| 166 | + 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
| 167 | + 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
| 168 | + 'multiple_queues' => true, |
|
| 169 | + 'max_file_size' => geodir_max_upload_size(), |
|
| 170 | + 'url' => $ajax_url, |
|
| 171 | + 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
| 172 | + 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
| 173 | + 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
|
|
| 174 | + 'multipart' => true, |
|
| 175 | + 'urlstream_upload' => true, |
|
| 176 | + 'multi_selection' => false, // will be added per uploader |
|
| 177 | + // additional post data to send to our ajax hook |
|
| 178 | + 'multipart_params' => array( |
|
| 179 | + '_ajax_nonce' => "", // will be added per uploader |
|
| 180 | + 'action' => 'plupload_action', // the ajax action name |
|
| 181 | + 'imgid' => 0 // will be added per uploader |
|
| 182 | + ) |
|
| 183 | + ); |
|
| 184 | + $base_plupload_config = json_encode($plupload_init); |
|
| 185 | + |
|
| 186 | + $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
|
|
| 187 | + 'upload_img_size' => geodir_max_upload_size()); |
|
| 188 | + |
|
| 189 | + wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
| 190 | + |
|
| 191 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 192 | + } // End if for add place page |
|
| 193 | + |
|
| 194 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 195 | + if ($is_detail_page) {
|
|
| 196 | 196 | wp_enqueue_script('geodirectory-post-custom-js');
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - // font awesome rating script |
|
| 199 | + // font awesome rating script |
|
| 200 | 200 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
| 201 | 201 | wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
| 202 | 202 | wp_enqueue_script('geodir-barrating-js');
|
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | wp_enqueue_script('geodir-jRating-js');
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 209 | - wp_enqueue_script('geodir-on-document-load');
|
|
| 208 | + wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 209 | + wp_enqueue_script('geodir-on-document-load');
|
|
| 210 | 210 | |
| 211 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 212 | - wp_enqueue_script('google-geometa');
|
|
| 211 | + wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 212 | + wp_enqueue_script('google-geometa');
|
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | function geodir_header_scripts() |
| 225 | 225 | {
|
| 226 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 227 | - echo stripslashes(get_option('geodir_header_scripts'));
|
|
| 226 | + echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 227 | + echo stripslashes(get_option('geodir_header_scripts'));
|
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | function geodir_footer_scripts() |
| 241 | 241 | {
|
| 242 | 242 | |
| 243 | - if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
|
|
| 243 | + if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
|
|
| 244 | 244 | |
| 245 | 245 | <script> |
| 246 | 246 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
@@ -254,20 +254,20 @@ discard block |
||
| 254 | 254 | </script> |
| 255 | 255 | |
| 256 | 256 | <?php |
| 257 | - }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 258 | - echo stripslashes(get_option('geodir_ga_tracking_code'));
|
|
| 259 | - } |
|
| 257 | + }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 258 | + echo stripslashes(get_option('geodir_ga_tracking_code'));
|
|
| 259 | + } |
|
| 260 | 260 | |
| 261 | - echo stripslashes(get_option('geodir_footer_scripts'));
|
|
| 261 | + echo stripslashes(get_option('geodir_footer_scripts'));
|
|
| 262 | 262 | |
| 263 | - /* |
|
| 263 | + /* |
|
| 264 | 264 | * Apple suck and can't/won't fix bugs: https://bugs.webkit.org/show_bug.cgi?id=136041 |
| 265 | 265 | * |
| 266 | 266 | * Flexbox wont wrap on ios for search form items |
| 267 | 267 | */ |
| 268 | - if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
|
|
| 269 | - echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
|
|
| 270 | - } |
|
| 268 | + if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
|
|
| 269 | + echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
|
|
| 270 | + } |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
@@ -281,12 +281,12 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | function geodir_add_async_forscript($url) |
| 283 | 283 | {
|
| 284 | - if (strpos($url, '#asyncload')===false) |
|
| 285 | - return $url; |
|
| 286 | - else if (is_admin()) |
|
| 287 | - return str_replace('#asyncload', '', $url);
|
|
| 288 | - else |
|
| 289 | - return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 284 | + if (strpos($url, '#asyncload')===false) |
|
| 285 | + return $url; |
|
| 286 | + else if (is_admin()) |
|
| 287 | + return str_replace('#asyncload', '', $url);
|
|
| 288 | + else |
|
| 289 | + return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 290 | 290 | } |
| 291 | 291 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
|
| 292 | 292 | |
@@ -299,17 +299,17 @@ discard block |
||
| 299 | 299 | function geodir_templates_styles() |
| 300 | 300 | {
|
| 301 | 301 | |
| 302 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 303 | - wp_enqueue_style('geodir-core-scss');
|
|
| 304 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 302 | + wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 303 | + wp_enqueue_style('geodir-core-scss');
|
|
| 304 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 305 | 305 | |
| 306 | - if(is_rtl()){
|
|
| 307 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 308 | - wp_enqueue_style('geodirectory-frontend-rtl-style');
|
|
| 309 | - } |
|
| 306 | + if(is_rtl()){
|
|
| 307 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 308 | + wp_enqueue_style('geodirectory-frontend-rtl-style');
|
|
| 309 | + } |
|
| 310 | 310 | |
| 311 | - wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
|
| 312 | - wp_enqueue_style('font-awesome');
|
|
| 311 | + wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
|
| 312 | + wp_enqueue_style('font-awesome');
|
|
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | function geodir_get_sidebar() |
| 325 | 325 | {
|
| 326 | - get_sidebar('geodirectory');
|
|
| 326 | + get_sidebar('geodirectory');
|
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
@@ -342,122 +342,122 @@ discard block |
||
| 342 | 342 | * @param bool $always_show Do you want to show the pagination always? Default: false. |
| 343 | 343 | */ |
| 344 | 344 | function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
|
| 345 | - global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
| 345 | + global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
| 346 | 346 | |
| 347 | - if (empty($prelabel)) {
|
|
| 348 | - $prelabel = '<strong>«</strong>'; |
|
| 349 | - } |
|
| 347 | + if (empty($prelabel)) {
|
|
| 348 | + $prelabel = '<strong>«</strong>'; |
|
| 349 | + } |
|
| 350 | 350 | |
| 351 | - if (empty($nxtlabel)) {
|
|
| 352 | - $nxtlabel = '<strong>»</strong>'; |
|
| 353 | - } |
|
| 351 | + if (empty($nxtlabel)) {
|
|
| 352 | + $nxtlabel = '<strong>»</strong>'; |
|
| 353 | + } |
|
| 354 | 354 | |
| 355 | - $half_pages_to_show = round($pages_to_show / 2); |
|
| 355 | + $half_pages_to_show = round($pages_to_show / 2); |
|
| 356 | 356 | |
| 357 | - if (geodir_is_page('home')) // dont apply default pagination for geodirectory home page.
|
|
| 358 | - return; |
|
| 357 | + if (geodir_is_page('home')) // dont apply default pagination for geodirectory home page.
|
|
| 358 | + return; |
|
| 359 | 359 | |
| 360 | - if (!is_single()) {
|
|
| 361 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 362 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 363 | - } |
|
| 364 | - $numposts = $wp_query->found_posts; |
|
| 360 | + if (!is_single()) {
|
|
| 361 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 362 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 363 | + } |
|
| 364 | + $numposts = $wp_query->found_posts; |
|
| 365 | 365 | |
| 366 | - $max_page = ceil($numposts / $posts_per_page); |
|
| 366 | + $max_page = ceil($numposts / $posts_per_page); |
|
| 367 | 367 | |
| 368 | - if (empty($paged)) {
|
|
| 369 | - $paged = 1; |
|
| 370 | - } |
|
| 368 | + if (empty($paged)) {
|
|
| 369 | + $paged = 1; |
|
| 370 | + } |
|
| 371 | 371 | |
| 372 | - $post_type = geodir_get_current_posttype(); |
|
| 373 | - $listing_type_name = get_post_type_plural_label($post_type); |
|
| 374 | - if (geodir_is_page('listing') || geodir_is_page('search')) {
|
|
| 375 | - $term = array(); |
|
| 372 | + $post_type = geodir_get_current_posttype(); |
|
| 373 | + $listing_type_name = get_post_type_plural_label($post_type); |
|
| 374 | + if (geodir_is_page('listing') || geodir_is_page('search')) {
|
|
| 375 | + $term = array(); |
|
| 376 | 376 | |
| 377 | - if (is_tax()) {
|
|
| 378 | - $term_id = get_queried_object_id(); |
|
| 379 | - $taxonomy = get_query_var('taxonomy');
|
|
| 377 | + if (is_tax()) {
|
|
| 378 | + $term_id = get_queried_object_id(); |
|
| 379 | + $taxonomy = get_query_var('taxonomy');
|
|
| 380 | 380 | |
| 381 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 382 | - $term = get_term($term_id, $post_type . 'category'); |
|
| 383 | - } |
|
| 384 | - } |
|
| 381 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 382 | + $term = get_term($term_id, $post_type . 'category'); |
|
| 383 | + } |
|
| 384 | + } |
|
| 385 | 385 | |
| 386 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 387 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 386 | + if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 387 | + $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 388 | 388 | |
| 389 | - if (!is_array($taxonomy_search)) {
|
|
| 390 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 391 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 392 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 393 | - } |
|
| 394 | - } |
|
| 389 | + if (!is_array($taxonomy_search)) {
|
|
| 390 | + $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 391 | + } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 392 | + $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 393 | + } |
|
| 394 | + } |
|
| 395 | 395 | |
| 396 | - if (!empty($term) && !is_wp_error($term)) {
|
|
| 397 | - $listing_type_name = $term->name; |
|
| 398 | - } |
|
| 399 | - } |
|
| 396 | + if (!empty($term) && !is_wp_error($term)) {
|
|
| 397 | + $listing_type_name = $term->name; |
|
| 398 | + } |
|
| 399 | + } |
|
| 400 | 400 | |
| 401 | - if ($max_page > 1 || $always_show) {
|
|
| 402 | - // Extra pagination info |
|
| 403 | - $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
| 404 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 405 | - $end_no = min($paged * $posts_per_page, $numposts); |
|
| 401 | + if ($max_page > 1 || $always_show) {
|
|
| 402 | + // Extra pagination info |
|
| 403 | + $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
| 404 | + $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 405 | + $end_no = min($paged * $posts_per_page, $numposts); |
|
| 406 | 406 | |
| 407 | - if ($geodir_pagination_more_info != '') {
|
|
| 408 | - if ($listing_type_name) {
|
|
| 409 | - $listing_type_name = __($listing_type_name, 'geodirectory'); |
|
| 410 | - $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
|
|
| 411 | - } else {
|
|
| 412 | - $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
|
| 413 | - } |
|
| 414 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 415 | - /** |
|
| 416 | - * Adds an extra pagination info above/under pagination. |
|
| 417 | - * |
|
| 418 | - * @since 1.5.9 |
|
| 419 | - * |
|
| 420 | - * @param string $pagination_info Extra pagination info content. |
|
| 421 | - * @param string $listing_type_name Listing results type. |
|
| 422 | - * @param string $start_no First result number. |
|
| 423 | - * @param string $end_no Last result number. |
|
| 424 | - * @param string $numposts Total number of listings. |
|
| 425 | - * @param string $post_type The post type. |
|
| 426 | - */ |
|
| 427 | - $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
|
| 407 | + if ($geodir_pagination_more_info != '') {
|
|
| 408 | + if ($listing_type_name) {
|
|
| 409 | + $listing_type_name = __($listing_type_name, 'geodirectory'); |
|
| 410 | + $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
|
|
| 411 | + } else {
|
|
| 412 | + $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
|
| 413 | + } |
|
| 414 | + $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 415 | + /** |
|
| 416 | + * Adds an extra pagination info above/under pagination. |
|
| 417 | + * |
|
| 418 | + * @since 1.5.9 |
|
| 419 | + * |
|
| 420 | + * @param string $pagination_info Extra pagination info content. |
|
| 421 | + * @param string $listing_type_name Listing results type. |
|
| 422 | + * @param string $start_no First result number. |
|
| 423 | + * @param string $end_no Last result number. |
|
| 424 | + * @param string $numposts Total number of listings. |
|
| 425 | + * @param string $post_type The post type. |
|
| 426 | + */ |
|
| 427 | + $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
|
| 428 | 428 | |
| 429 | - if ($geodir_pagination_more_info == 'before') {
|
|
| 430 | - $before = $before . $pagination_info; |
|
| 431 | - } else if ($geodir_pagination_more_info == 'after') {
|
|
| 432 | - $after = $pagination_info . $after; |
|
| 433 | - } |
|
| 434 | - } |
|
| 429 | + if ($geodir_pagination_more_info == 'before') {
|
|
| 430 | + $before = $before . $pagination_info; |
|
| 431 | + } else if ($geodir_pagination_more_info == 'after') {
|
|
| 432 | + $after = $pagination_info . $after; |
|
| 433 | + } |
|
| 434 | + } |
|
| 435 | 435 | |
| 436 | - echo "$before <div class='Navi gd-navi'>"; |
|
| 437 | - if ($paged >= ($pages_to_show - 1)) {
|
|
| 438 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 439 | - } |
|
| 440 | - previous_posts_link($prelabel); |
|
| 441 | - for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
|
| 442 | - if ($i >= 1 && $i <= $max_page) {
|
|
| 443 | - if ($i == $paged) {
|
|
| 444 | - echo "<strong class='on'>$i</strong>"; |
|
| 445 | - } else {
|
|
| 446 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 447 | - } |
|
| 448 | - } |
|
| 449 | - } |
|
| 450 | - next_posts_link($nxtlabel, $max_page); |
|
| 451 | - if (($paged + $half_pages_to_show) < ($max_page)) {
|
|
| 452 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 453 | - } |
|
| 454 | - echo "</div> $after"; |
|
| 455 | - } |
|
| 436 | + echo "$before <div class='Navi gd-navi'>"; |
|
| 437 | + if ($paged >= ($pages_to_show - 1)) {
|
|
| 438 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 439 | + } |
|
| 440 | + previous_posts_link($prelabel); |
|
| 441 | + for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
|
| 442 | + if ($i >= 1 && $i <= $max_page) {
|
|
| 443 | + if ($i == $paged) {
|
|
| 444 | + echo "<strong class='on'>$i</strong>"; |
|
| 445 | + } else {
|
|
| 446 | + echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 447 | + } |
|
| 448 | + } |
|
| 449 | + } |
|
| 450 | + next_posts_link($nxtlabel, $max_page); |
|
| 451 | + if (($paged + $half_pages_to_show) < ($max_page)) {
|
|
| 452 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 453 | + } |
|
| 454 | + echo "</div> $after"; |
|
| 455 | + } |
|
| 456 | 456 | |
| 457 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 458 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 459 | - } |
|
| 460 | - } |
|
| 457 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 458 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 459 | + } |
|
| 460 | + } |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | /** |
@@ -468,20 +468,20 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | function geodir_listingsearch_scripts() |
| 470 | 470 | {
|
| 471 | - if (get_option('gd_search_dist') != '') {
|
|
| 472 | - $dist = get_option('gd_search_dist');
|
|
| 473 | - } else {
|
|
| 474 | - $dist = 500; |
|
| 475 | - } |
|
| 476 | - $dist_dif = 1000; |
|
| 477 | - |
|
| 478 | - if ($dist <= 5000) $dist_dif = 500; |
|
| 479 | - if ($dist <= 1000) $dist_dif = 100; |
|
| 480 | - if ($dist <= 500) $dist_dif = 50; |
|
| 481 | - if ($dist <= 100) $dist_dif = 10; |
|
| 482 | - if ($dist <= 50) $dist_dif = 5; |
|
| 483 | - |
|
| 484 | - ?> |
|
| 471 | + if (get_option('gd_search_dist') != '') {
|
|
| 472 | + $dist = get_option('gd_search_dist');
|
|
| 473 | + } else {
|
|
| 474 | + $dist = 500; |
|
| 475 | + } |
|
| 476 | + $dist_dif = 1000; |
|
| 477 | + |
|
| 478 | + if ($dist <= 5000) $dist_dif = 500; |
|
| 479 | + if ($dist <= 1000) $dist_dif = 100; |
|
| 480 | + if ($dist <= 500) $dist_dif = 50; |
|
| 481 | + if ($dist <= 100) $dist_dif = 10; |
|
| 482 | + if ($dist <= 50) $dist_dif = 5; |
|
| 483 | + |
|
| 484 | + ?> |
|
| 485 | 485 | <script type="text/javascript"> |
| 486 | 486 | |
| 487 | 487 | jQuery(function ($) {
|
@@ -540,15 +540,15 @@ discard block |
||
| 540 | 540 | function geodir_add_sharelocation_scripts() |
| 541 | 541 | {
|
| 542 | 542 | |
| 543 | - $default_search_for_text = SEARCH_FOR_TEXT; |
|
| 544 | - if (get_option('geodir_search_field_default_text'))
|
|
| 545 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
|
|
| 543 | + $default_search_for_text = SEARCH_FOR_TEXT; |
|
| 544 | + if (get_option('geodir_search_field_default_text'))
|
|
| 545 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
|
|
| 546 | 546 | |
| 547 | - $default_near_text = NEAR_TEXT; |
|
| 548 | - if (get_option('geodir_near_field_default_text'))
|
|
| 549 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
|
|
| 547 | + $default_near_text = NEAR_TEXT; |
|
| 548 | + if (get_option('geodir_near_field_default_text'))
|
|
| 549 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
|
|
| 550 | 550 | |
| 551 | - ?> |
|
| 551 | + ?> |
|
| 552 | 552 | |
| 553 | 553 | |
| 554 | 554 | <script type="text/javascript"> |
@@ -631,14 +631,14 @@ discard block |
||
| 631 | 631 | initialise2(); |
| 632 | 632 | } else {
|
| 633 | 633 | <?php |
| 634 | - $near_add = get_option('geodir_search_near_addition');
|
|
| 635 | - /** |
|
| 636 | - * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
| 637 | - * |
|
| 638 | - * @since 1.0.0 |
|
| 639 | - */ |
|
| 640 | - $near_add2 = apply_filters('geodir_search_near_addition', '');
|
|
| 641 | - ?> |
|
| 634 | + $near_add = get_option('geodir_search_near_addition');
|
|
| 635 | + /** |
|
| 636 | + * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
| 637 | + * |
|
| 638 | + * @since 1.0.0 |
|
| 639 | + */ |
|
| 640 | + $near_add2 = apply_filters('geodir_search_near_addition', '');
|
|
| 641 | + ?> |
|
| 642 | 642 | if (window.gdMaps === 'google') {
|
| 643 | 643 | Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
|
| 644 | 644 | function (results, status) {
|
@@ -741,30 +741,30 @@ discard block |
||
| 741 | 741 | */ |
| 742 | 742 | function geodir_show_badges_on_image($which, $post, $link) |
| 743 | 743 | {
|
| 744 | - $return = ''; |
|
| 745 | - switch ($which) {
|
|
| 746 | - case 'featured': |
|
| 747 | - /** |
|
| 748 | - * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
| 749 | - * |
|
| 750 | - * @since 1.0.0 |
|
| 751 | - * @param object $post The post object. |
|
| 752 | - * @param string $link The link to the post. |
|
| 753 | - */ |
|
| 754 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 755 | - break; |
|
| 756 | - case 'new' : |
|
| 757 | - /** |
|
| 758 | - * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
| 759 | - * |
|
| 760 | - * @since 1.0.0 |
|
| 761 | - * @param object $post The post object. |
|
| 762 | - * @param string $link The link to the post. |
|
| 763 | - */ |
|
| 764 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 765 | - break; |
|
| 766 | - |
|
| 767 | - } |
|
| 744 | + $return = ''; |
|
| 745 | + switch ($which) {
|
|
| 746 | + case 'featured': |
|
| 747 | + /** |
|
| 748 | + * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
| 749 | + * |
|
| 750 | + * @since 1.0.0 |
|
| 751 | + * @param object $post The post object. |
|
| 752 | + * @param string $link The link to the post. |
|
| 753 | + */ |
|
| 754 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 755 | + break; |
|
| 756 | + case 'new' : |
|
| 757 | + /** |
|
| 758 | + * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
| 759 | + * |
|
| 760 | + * @since 1.0.0 |
|
| 761 | + * @param object $post The post object. |
|
| 762 | + * @param string $link The link to the post. |
|
| 763 | + */ |
|
| 764 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 765 | + break; |
|
| 766 | + |
|
| 767 | + } |
|
| 768 | 768 | |
| 769 | - return $return; |
|
| 769 | + return $return; |
|
| 770 | 770 | } |
@@ -19,149 +19,149 @@ discard block |
||
| 19 | 19 | * @global string $dummy_image_path The dummy image path. |
| 20 | 20 | */ |
| 21 | 21 | function geodir_dummy_data_taxonomies($post_type,$category_array) { |
| 22 | - global $wpdb, $dummy_image_path; |
|
| 22 | + global $wpdb, $dummy_image_path; |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - $last_catid = ''; |
|
| 26 | + $last_catid = ''; |
|
| 27 | 27 | |
| 28 | - $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 28 | + $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 29 | 29 | |
| 30 | - for ($i = 0; $i < count($category_array); $i++) { |
|
| 31 | - $parent_catid = 0; |
|
| 32 | - if (is_array($category_array[$i])) { |
|
| 33 | - $cat_name_arr = $category_array[$i]; |
|
| 34 | - for ($j = 0; $j < count($cat_name_arr); $j++) { |
|
| 35 | - $catname = $cat_name_arr[$j]; |
|
| 30 | + for ($i = 0; $i < count($category_array); $i++) { |
|
| 31 | + $parent_catid = 0; |
|
| 32 | + if (is_array($category_array[$i])) { |
|
| 33 | + $cat_name_arr = $category_array[$i]; |
|
| 34 | + for ($j = 0; $j < count($cat_name_arr); $j++) { |
|
| 35 | + $catname = $cat_name_arr[$j]; |
|
| 36 | 36 | |
| 37 | - if (!term_exists($catname, $post_type.'category')) { |
|
| 38 | - $last_catid = wp_insert_term($catname, $post_type.'category', $args = array('parent' => $parent_catid)); |
|
| 37 | + if (!term_exists($catname, $post_type.'category')) { |
|
| 38 | + $last_catid = wp_insert_term($catname, $post_type.'category', $args = array('parent' => $parent_catid)); |
|
| 39 | 39 | |
| 40 | - if ($j == 0) { |
|
| 41 | - $parent_catid = $last_catid; |
|
| 42 | - } |
|
| 40 | + if ($j == 0) { |
|
| 41 | + $parent_catid = $last_catid; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | - if (geodir_dummy_folder_exists()) |
|
| 46 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 47 | - else |
|
| 48 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 45 | + if (geodir_dummy_folder_exists()) |
|
| 46 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 47 | + else |
|
| 48 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 49 | 49 | |
| 50 | - $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 50 | + $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 51 | 51 | |
| 52 | - $catname = str_replace(' ', '_', $catname); |
|
| 53 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 52 | + $catname = str_replace(' ', '_', $catname); |
|
| 53 | + $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 54 | 54 | |
| 55 | - if (empty($uploaded['error'])) { |
|
| 56 | - $new_path = $uploaded['file']; |
|
| 57 | - $new_url = $uploaded['url']; |
|
| 58 | - } |
|
| 55 | + if (empty($uploaded['error'])) { |
|
| 56 | + $new_path = $uploaded['file']; |
|
| 57 | + $new_url = $uploaded['url']; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 61 | - |
|
| 62 | - $attachment = array( |
|
| 63 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 64 | - 'post_mime_type' => $wp_filetype['type'], |
|
| 65 | - 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 66 | - 'post_content' => '', |
|
| 67 | - 'post_status' => 'inherit' |
|
| 68 | - ); |
|
| 69 | - $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 70 | - |
|
| 71 | - // you must first include the image.php file |
|
| 72 | - // for the function wp_generate_attachment_metadata() to work |
|
| 73 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 74 | - $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 75 | - wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 76 | - |
|
| 77 | - if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 78 | - update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), $post_type); |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - } |
|
| 60 | + $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 82 | 61 | |
| 83 | - } else { |
|
| 84 | - $catname = $category_array[$i]; |
|
| 62 | + $attachment = array( |
|
| 63 | + 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 64 | + 'post_mime_type' => $wp_filetype['type'], |
|
| 65 | + 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 66 | + 'post_content' => '', |
|
| 67 | + 'post_status' => 'inherit' |
|
| 68 | + ); |
|
| 69 | + $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 85 | 70 | |
| 86 | - if (!term_exists($catname, $post_type.'category')) { |
|
| 87 | - $last_catid = wp_insert_term($catname, $post_type.'category'); |
|
| 71 | + // you must first include the image.php file |
|
| 72 | + // for the function wp_generate_attachment_metadata() to work |
|
| 73 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 74 | + $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 75 | + wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 88 | 76 | |
| 89 | - if (geodir_dummy_folder_exists()) |
|
| 90 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 91 | - else |
|
| 92 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 77 | + if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 78 | + update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), $post_type); |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + } |
|
| 93 | 82 | |
| 94 | - $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 83 | + } else { |
|
| 84 | + $catname = $category_array[$i]; |
|
| 95 | 85 | |
| 96 | - $catname = str_replace(' ', '_', $catname); |
|
| 97 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 86 | + if (!term_exists($catname, $post_type.'category')) { |
|
| 87 | + $last_catid = wp_insert_term($catname, $post_type.'category'); |
|
| 98 | 88 | |
| 99 | - if (empty($uploaded['error'])) { |
|
| 100 | - $new_path = $uploaded['file']; |
|
| 101 | - $new_url = $uploaded['url']; |
|
| 102 | - } |
|
| 89 | + if (geodir_dummy_folder_exists()) |
|
| 90 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 91 | + else |
|
| 92 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 103 | 93 | |
| 104 | - $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 94 | + $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 105 | 95 | |
| 106 | - $attachment = array( |
|
| 107 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 108 | - 'post_mime_type' => $wp_filetype['type'], |
|
| 109 | - 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 110 | - 'post_content' => '', |
|
| 111 | - 'post_status' => 'inherit' |
|
| 112 | - ); |
|
| 96 | + $catname = str_replace(' ', '_', $catname); |
|
| 97 | + $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 113 | 98 | |
| 114 | - $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 99 | + if (empty($uploaded['error'])) { |
|
| 100 | + $new_path = $uploaded['file']; |
|
| 101 | + $new_url = $uploaded['url']; |
|
| 102 | + } |
|
| 115 | 103 | |
| 104 | + $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 116 | 105 | |
| 117 | - // you must first include the image.php file |
|
| 118 | - // for the function wp_generate_attachment_metadata() to work |
|
| 119 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 120 | - $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 121 | - wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 106 | + $attachment = array( |
|
| 107 | + 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 108 | + 'post_mime_type' => $wp_filetype['type'], |
|
| 109 | + 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 110 | + 'post_content' => '', |
|
| 111 | + 'post_status' => 'inherit' |
|
| 112 | + ); |
|
| 113 | + |
|
| 114 | + $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 122 | 115 | |
| 123 | - if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 124 | - update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => $attach_id, 'src' => $new_url), $post_type); |
|
| 125 | - } |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | 116 | |
| 129 | - } |
|
| 117 | + // you must first include the image.php file |
|
| 118 | + // for the function wp_generate_attachment_metadata() to work |
|
| 119 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 120 | + $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 121 | + wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 122 | + |
|
| 123 | + if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 124 | + update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => $attach_id, 'src' => $new_url), $post_type); |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + } |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | function geodir_dummy_data_types(){ |
| 134 | - return array( |
|
| 135 | - 'standard_places' => array( |
|
| 136 | - 'name'=>__('Default','geodirectory'), |
|
| 137 | - 'count'=> 30 |
|
| 138 | - ), |
|
| 139 | - 'property_sale' => array( |
|
| 140 | - 'name'=>__('Property for sale','geodirectory'), |
|
| 141 | - 'count'=> 10 |
|
| 142 | - ), |
|
| 143 | - 'property_rent' => array( |
|
| 144 | - 'name'=>__('Property for rent','geodirectory'), |
|
| 145 | - 'count'=> 10 |
|
| 146 | - ) |
|
| 147 | - ); |
|
| 134 | + return array( |
|
| 135 | + 'standard_places' => array( |
|
| 136 | + 'name'=>__('Default','geodirectory'), |
|
| 137 | + 'count'=> 30 |
|
| 138 | + ), |
|
| 139 | + 'property_sale' => array( |
|
| 140 | + 'name'=>__('Property for sale','geodirectory'), |
|
| 141 | + 'count'=> 10 |
|
| 142 | + ), |
|
| 143 | + 'property_rent' => array( |
|
| 144 | + 'name'=>__('Property for rent','geodirectory'), |
|
| 145 | + 'count'=> 10 |
|
| 146 | + ) |
|
| 147 | + ); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | function geodir_create_dummy_fields($fields) |
| 152 | 152 | { |
| 153 | 153 | |
| 154 | - /** |
|
| 155 | - * Filter the array of default custom fields DB table data. |
|
| 156 | - * |
|
| 157 | - * @since 1.0.0 |
|
| 158 | - * @param string $fields The default custom fields as an array. |
|
| 159 | - */ |
|
| 160 | - $fields = apply_filters('geodir_before_dummy_custom_fields_saved', $fields); |
|
| 161 | - foreach ($fields as $field_index => $field) { |
|
| 162 | - geodir_custom_field_save($field); |
|
| 163 | - |
|
| 164 | - } |
|
| 154 | + /** |
|
| 155 | + * Filter the array of default custom fields DB table data. |
|
| 156 | + * |
|
| 157 | + * @since 1.0.0 |
|
| 158 | + * @param string $fields The default custom fields as an array. |
|
| 159 | + */ |
|
| 160 | + $fields = apply_filters('geodir_before_dummy_custom_fields_saved', $fields); |
|
| 161 | + foreach ($fields as $field_index => $field) { |
|
| 162 | + geodir_custom_field_save($field); |
|
| 163 | + |
|
| 164 | + } |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -174,20 +174,20 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | function geodir_delete_dummy_posts($post_type,$data_type) |
| 176 | 176 | { |
| 177 | - global $wpdb, $plugin_prefix; |
|
| 177 | + global $wpdb, $plugin_prefix; |
|
| 178 | 178 | |
| 179 | 179 | |
| 180 | - $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . $post_type."_detail WHERE post_dummy='1'"); |
|
| 180 | + $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . $post_type."_detail WHERE post_dummy='1'"); |
|
| 181 | 181 | |
| 182 | 182 | |
| 183 | - foreach ($post_ids as $post_ids_obj) { |
|
| 184 | - wp_delete_post($post_ids_obj->post_id); |
|
| 185 | - } |
|
| 183 | + foreach ($post_ids as $post_ids_obj) { |
|
| 184 | + wp_delete_post($post_ids_obj->post_id); |
|
| 185 | + } |
|
| 186 | 186 | |
| 187 | - //double check posts are deleted |
|
| 188 | - $wpdb->get_results("DELETE FROM " . $plugin_prefix . $post_type. "_detail WHERE post_dummy='1'"); |
|
| 187 | + //double check posts are deleted |
|
| 188 | + $wpdb->get_results("DELETE FROM " . $plugin_prefix . $post_type. "_detail WHERE post_dummy='1'"); |
|
| 189 | 189 | |
| 190 | - update_option($post_type.'_dummy_data_type',''); |
|
| 190 | + update_option($post_type.'_dummy_data_type',''); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -201,78 +201,78 @@ discard block |
||
| 201 | 201 | function geodir_insert_dummy_posts($post_type,$data_type,$item_index) |
| 202 | 202 | { |
| 203 | 203 | |
| 204 | - ini_set('max_execution_time', 999999); //300 seconds = 5 minutes |
|
| 205 | - $data_types = geodir_dummy_data_types(); |
|
| 206 | - |
|
| 207 | - $total_count = 0; |
|
| 208 | - global $dummy_post_index; |
|
| 209 | - $dummy_post_index = $item_index; |
|
| 210 | - foreach( $data_types as $key=>$val){ |
|
| 211 | - if($key==$data_type){ |
|
| 212 | - $total_count = $val['count']; |
|
| 213 | - if($key=='standard_places'){ |
|
| 214 | - /** |
|
| 215 | - * Contains dummy post content. |
|
| 216 | - * |
|
| 217 | - * @since 1.0.0 |
|
| 218 | - * @package GeoDirectory |
|
| 219 | - */ |
|
| 220 | - include_once( 'dummy-data/standard_places.php' ); |
|
| 221 | - }elseif($key=='property_sale'){ |
|
| 222 | - /** |
|
| 223 | - * Contains dummy property for sale post content. |
|
| 224 | - * |
|
| 225 | - * @since 1.6.11 |
|
| 226 | - * @package GeoDirectory |
|
| 227 | - */ |
|
| 228 | - include_once( 'dummy-data/property_sale.php' ); |
|
| 229 | - }elseif($key=='property_rent'){ |
|
| 230 | - /** |
|
| 231 | - * Contains dummy property for sale post content. |
|
| 232 | - * |
|
| 233 | - * @since 1.6.11 |
|
| 234 | - * @package GeoDirectory |
|
| 235 | - */ |
|
| 236 | - include_once( 'dummy-data/property_rent.php' ); |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - } |
|
| 240 | - |
|
| 241 | - do_action('geodir_insert_dummy_data_loop',$post_type,$data_type,$item_index); |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - |
|
| 245 | - |
|
| 246 | - // delete image cache on last entry |
|
| 247 | - if($total_count == $item_index){ |
|
| 248 | - delete_transient( 'cached_dummy_images' ); |
|
| 249 | - flush_rewrite_rules(); |
|
| 250 | - } |
|
| 204 | + ini_set('max_execution_time', 999999); //300 seconds = 5 minutes |
|
| 205 | + $data_types = geodir_dummy_data_types(); |
|
| 206 | + |
|
| 207 | + $total_count = 0; |
|
| 208 | + global $dummy_post_index; |
|
| 209 | + $dummy_post_index = $item_index; |
|
| 210 | + foreach( $data_types as $key=>$val){ |
|
| 211 | + if($key==$data_type){ |
|
| 212 | + $total_count = $val['count']; |
|
| 213 | + if($key=='standard_places'){ |
|
| 214 | + /** |
|
| 215 | + * Contains dummy post content. |
|
| 216 | + * |
|
| 217 | + * @since 1.0.0 |
|
| 218 | + * @package GeoDirectory |
|
| 219 | + */ |
|
| 220 | + include_once( 'dummy-data/standard_places.php' ); |
|
| 221 | + }elseif($key=='property_sale'){ |
|
| 222 | + /** |
|
| 223 | + * Contains dummy property for sale post content. |
|
| 224 | + * |
|
| 225 | + * @since 1.6.11 |
|
| 226 | + * @package GeoDirectory |
|
| 227 | + */ |
|
| 228 | + include_once( 'dummy-data/property_sale.php' ); |
|
| 229 | + }elseif($key=='property_rent'){ |
|
| 230 | + /** |
|
| 231 | + * Contains dummy property for sale post content. |
|
| 232 | + * |
|
| 233 | + * @since 1.6.11 |
|
| 234 | + * @package GeoDirectory |
|
| 235 | + */ |
|
| 236 | + include_once( 'dummy-data/property_rent.php' ); |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + do_action('geodir_insert_dummy_data_loop',$post_type,$data_type,$item_index); |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + |
|
| 245 | + |
|
| 246 | + // delete image cache on last entry |
|
| 247 | + if($total_count == $item_index){ |
|
| 248 | + delete_transient( 'cached_dummy_images' ); |
|
| 249 | + flush_rewrite_rules(); |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | 252 | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined( 'GD_TESTING_MODE' ))) { |
| 257 | - /** |
|
| 258 | - * GeoDirectory dummy data installation. |
|
| 259 | - * |
|
| 260 | - * @since 1.0.0 |
|
| 261 | - * @package GeoDirectory |
|
| 262 | - * @global object $wpdb WordPress Database object. |
|
| 263 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 264 | - * @param string $post_type The post type. |
|
| 265 | - */ |
|
| 266 | - function geodir_autoinstall_admin_header($post_type = 'gd_place') |
|
| 267 | - { |
|
| 268 | - |
|
| 269 | - global $wpdb, $plugin_prefix; |
|
| 270 | - |
|
| 271 | - if (!geodir_is_default_location_set()) { |
|
| 272 | - echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
| 273 | - } else { |
|
| 274 | - |
|
| 275 | - ?> |
|
| 257 | + /** |
|
| 258 | + * GeoDirectory dummy data installation. |
|
| 259 | + * |
|
| 260 | + * @since 1.0.0 |
|
| 261 | + * @package GeoDirectory |
|
| 262 | + * @global object $wpdb WordPress Database object. |
|
| 263 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 264 | + * @param string $post_type The post type. |
|
| 265 | + */ |
|
| 266 | + function geodir_autoinstall_admin_header($post_type = 'gd_place') |
|
| 267 | + { |
|
| 268 | + |
|
| 269 | + global $wpdb, $plugin_prefix; |
|
| 270 | + |
|
| 271 | + if (!geodir_is_default_location_set()) { |
|
| 272 | + echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
| 273 | + } else { |
|
| 274 | + |
|
| 275 | + ?> |
|
| 276 | 276 | <table class="form-table gd-dummy-table"> |
| 277 | 277 | <tbody> |
| 278 | 278 | <tr> |
@@ -283,77 +283,77 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | <?php |
| 285 | 285 | |
| 286 | - $cpts = geodir_get_posttypes('array'); |
|
| 286 | + $cpts = geodir_get_posttypes('array'); |
|
| 287 | 287 | |
| 288 | - $data_types = geodir_dummy_data_types(); |
|
| 288 | + $data_types = geodir_dummy_data_types(); |
|
| 289 | 289 | |
| 290 | - $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename'); |
|
| 290 | + $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename'); |
|
| 291 | 291 | |
| 292 | - foreach($cpts as $post_type=>$cpt){ |
|
| 292 | + foreach($cpts as $post_type=>$cpt){ |
|
| 293 | 293 | |
| 294 | - $data_types_for = apply_filters('geodir_dummy_date_types_for',$data_types,$post_type); |
|
| 294 | + $data_types_for = apply_filters('geodir_dummy_date_types_for',$data_types,$post_type); |
|
| 295 | 295 | |
| 296 | 296 | |
| 297 | - $set_dt = get_option($post_type.'_dummy_data_type'); |
|
| 297 | + $set_dt = get_option($post_type.'_dummy_data_type'); |
|
| 298 | 298 | |
| 299 | - $count = 30; |
|
| 299 | + $count = 30; |
|
| 300 | 300 | |
| 301 | - geodir_add_column_if_not_exist($plugin_prefix . $post_type. "_detail", 'post_dummy', "enum( '1', '0' ) NULL DEFAULT '0'"); |
|
| 301 | + geodir_add_column_if_not_exist($plugin_prefix . $post_type. "_detail", 'post_dummy', "enum( '1', '0' ) NULL DEFAULT '0'"); |
|
| 302 | 302 | |
| 303 | - $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'"); |
|
| 303 | + $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'"); |
|
| 304 | 304 | |
| 305 | - echo "<tr>"; |
|
| 306 | - echo "<td><strong>".$cpt['labels']['name']."</strong></td>"; |
|
| 305 | + echo "<tr>"; |
|
| 306 | + echo "<td><strong>".$cpt['labels']['name']."</strong></td>"; |
|
| 307 | 307 | |
| 308 | 308 | |
| 309 | - $select_disabled = $post_counts > 0 ? 'disabled' : ''; |
|
| 310 | - echo "<td>"; |
|
| 311 | - echo "<select id='".$post_type."_data_type' onchange='geodir_dummy_set_count(this,\"$post_type\");' $select_disabled>"; |
|
| 312 | - foreach($data_types_for as $key=>$val){ |
|
| 313 | - $selected = ($key==$set_dt) ? "selected='selected'" : ''; |
|
| 314 | - if($selected){$count = $val['count'];} |
|
| 315 | - echo "<option $selected value='$key' data-count='".$val['count']."'>".$val['name']."</option>"; |
|
| 316 | - } |
|
| 317 | - echo "</select>"; |
|
| 318 | - |
|
| 319 | - $select_display = $post_counts > 0 ? 'display:none;' : ''; |
|
| 320 | - echo "<select id='".$post_type."_data_type_count' style='$select_display' >"; |
|
| 321 | - $x = 1; |
|
| 322 | - while($x <= $count){ |
|
| 323 | - $selected = ($x==$count) ? "selected='selected'" : ''; |
|
| 324 | - echo "<option $selected value='$x'>".$x."</option>"; |
|
| 325 | - $x++; |
|
| 326 | - } |
|
| 327 | - echo "</select>"; |
|
| 328 | - echo "</td>"; |
|
| 309 | + $select_disabled = $post_counts > 0 ? 'disabled' : ''; |
|
| 310 | + echo "<td>"; |
|
| 311 | + echo "<select id='".$post_type."_data_type' onchange='geodir_dummy_set_count(this,\"$post_type\");' $select_disabled>"; |
|
| 312 | + foreach($data_types_for as $key=>$val){ |
|
| 313 | + $selected = ($key==$set_dt) ? "selected='selected'" : ''; |
|
| 314 | + if($selected){$count = $val['count'];} |
|
| 315 | + echo "<option $selected value='$key' data-count='".$val['count']."'>".$val['name']."</option>"; |
|
| 316 | + } |
|
| 317 | + echo "</select>"; |
|
| 329 | 318 | |
| 319 | + $select_display = $post_counts > 0 ? 'display:none;' : ''; |
|
| 320 | + echo "<select id='".$post_type."_data_type_count' style='$select_display' >"; |
|
| 321 | + $x = 1; |
|
| 322 | + while($x <= $count){ |
|
| 323 | + $selected = ($x==$count) ? "selected='selected'" : ''; |
|
| 324 | + echo "<option $selected value='$x'>".$x."</option>"; |
|
| 325 | + $x++; |
|
| 326 | + } |
|
| 327 | + echo "</select>"; |
|
| 328 | + echo "</td>"; |
|
| 330 | 329 | |
| 331 | 330 | |
| 332 | 331 | |
| 333 | 332 | |
| 334 | - if($post_counts > 0){ |
|
| 335 | - echo '<td><input type="button" value="'.__('Remove data','geodirectory').'" class="button-primary geodir_dummy_button gd-remove-data" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 336 | - }else{ |
|
| 337 | - echo '<td><input type="button" value="'.__('Insert data','geodirectory').'" class="button-primary geodir_dummy_button" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 338 | - } |
|
| 339 | 333 | |
| 340 | - echo "</tr>"; |
|
| 341 | - //print_r($cpt); |
|
| 342 | - } |
|
| 334 | + if($post_counts > 0){ |
|
| 335 | + echo '<td><input type="button" value="'.__('Remove data','geodirectory').'" class="button-primary geodir_dummy_button gd-remove-data" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 336 | + }else{ |
|
| 337 | + echo '<td><input type="button" value="'.__('Insert data','geodirectory').'" class="button-primary geodir_dummy_button" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 338 | + } |
|
| 339 | + |
|
| 340 | + echo "</tr>"; |
|
| 341 | + //print_r($cpt); |
|
| 342 | + } |
|
| 343 | 343 | |
| 344 | - ?> |
|
| 344 | + ?> |
|
| 345 | 345 | </tbody> |
| 346 | 346 | </table> |
| 347 | 347 | <?php |
| 348 | 348 | |
| 349 | 349 | |
| 350 | - $default_location = geodir_get_default_location(); |
|
| 351 | - $city = isset($default_location->city) ? $default_location->city : ''; |
|
| 352 | - $region = isset($default_location->region) ? $default_location->region : ''; |
|
| 353 | - $country = isset($default_location->country) ? $default_location->country : ''; |
|
| 354 | - $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
| 355 | - $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
| 356 | - ?> |
|
| 350 | + $default_location = geodir_get_default_location(); |
|
| 351 | + $city = isset($default_location->city) ? $default_location->city : ''; |
|
| 352 | + $region = isset($default_location->region) ? $default_location->region : ''; |
|
| 353 | + $country = isset($default_location->country) ? $default_location->country : ''; |
|
| 354 | + $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
| 355 | + $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
| 356 | + ?> |
|
| 357 | 357 | <script type="text/javascript"> |
| 358 | 358 | |
| 359 | 359 | function geodir_dummy_set_count(data,cpt){ |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | </script> |
| 565 | 565 | <?php |
| 566 | - } |
|
| 567 | - } |
|
| 566 | + } |
|
| 567 | + } |
|
| 568 | 568 | } |
| 569 | 569 | |
@@ -13,125 +13,125 @@ discard block |
||
| 13 | 13 | * @package GeoDirectory |
| 14 | 14 | */ |
| 15 | 15 | function geodir_deactivation() {
|
| 16 | - // Update installed variable |
|
| 17 | - update_option("geodir_installed", 0);
|
|
| 16 | + // Update installed variable |
|
| 17 | + update_option("geodir_installed", 0);
|
|
| 18 | 18 | |
| 19 | - // Remove rewrite rules and then recreate rewrite rules. |
|
| 20 | - flush_rewrite_rules(); |
|
| 19 | + // Remove rewrite rules and then recreate rewrite rules. |
|
| 20 | + flush_rewrite_rules(); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | if (!function_exists('geodir_admin_styles')) {
|
| 24 | - /** |
|
| 25 | - * Enqueue Admin Styles. |
|
| 26 | - * |
|
| 27 | - * @since 1.0.0 |
|
| 28 | - * @package GeoDirectory |
|
| 29 | - */ |
|
| 30 | - function geodir_admin_styles() {
|
|
| 31 | - wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
|
|
| 32 | - wp_enqueue_style('geodirectory-admin-css');
|
|
| 24 | + /** |
|
| 25 | + * Enqueue Admin Styles. |
|
| 26 | + * |
|
| 27 | + * @since 1.0.0 |
|
| 28 | + * @package GeoDirectory |
|
| 29 | + */ |
|
| 30 | + function geodir_admin_styles() {
|
|
| 31 | + wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
|
|
| 32 | + wp_enqueue_style('geodirectory-admin-css');
|
|
| 33 | 33 | |
| 34 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 35 | - wp_enqueue_style('geodirectory-frontend-style');
|
|
| 34 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 35 | + wp_enqueue_style('geodirectory-frontend-style');
|
|
| 36 | 36 | |
| 37 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 38 | - wp_enqueue_style('geodir-chosen-style');
|
|
| 37 | + wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 38 | + wp_enqueue_style('geodir-chosen-style');
|
|
| 39 | 39 | |
| 40 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 41 | - wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
|
|
| 40 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 41 | + wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
|
|
| 42 | 42 | |
| 43 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 44 | - wp_enqueue_style('geodirectory-jquery-ui-css');
|
|
| 43 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 44 | + wp_enqueue_style('geodirectory-jquery-ui-css');
|
|
| 45 | 45 | |
| 46 | - wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
|
|
| 47 | - wp_enqueue_style('geodirectory-custom-fields-css');
|
|
| 46 | + wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
|
|
| 47 | + wp_enqueue_style('geodirectory-custom-fields-css');
|
|
| 48 | 48 | |
| 49 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 50 | - wp_enqueue_style('geodirectory-pluplodar-css');
|
|
| 49 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 50 | + wp_enqueue_style('geodirectory-pluplodar-css');
|
|
| 51 | 51 | |
| 52 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 53 | - wp_enqueue_style('geodir-rating-style');
|
|
| 52 | + wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 53 | + wp_enqueue_style('geodir-rating-style');
|
|
| 54 | 54 | |
| 55 | - wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
|
|
| 56 | - wp_enqueue_style('geodir-rtl-style');
|
|
| 57 | - } |
|
| 55 | + wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
|
|
| 56 | + wp_enqueue_style('geodir-rtl-style');
|
|
| 57 | + } |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if (!function_exists('geodir_admin_styles_req')) {
|
| 61 | - /** |
|
| 62 | - * Loads stylesheets from CDN. |
|
| 63 | - * |
|
| 64 | - * @since 1.0.0 |
|
| 65 | - * @package GeoDirectory |
|
| 66 | - */ |
|
| 67 | - function geodir_admin_styles_req() |
|
| 68 | - {
|
|
| 61 | + /** |
|
| 62 | + * Loads stylesheets from CDN. |
|
| 63 | + * |
|
| 64 | + * @since 1.0.0 |
|
| 65 | + * @package GeoDirectory |
|
| 66 | + */ |
|
| 67 | + function geodir_admin_styles_req() |
|
| 68 | + {
|
|
| 69 | 69 | |
| 70 | - wp_register_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
|
| 71 | - wp_enqueue_style('font-awesome');
|
|
| 70 | + wp_register_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
|
| 71 | + wp_enqueue_style('font-awesome');
|
|
| 72 | 72 | |
| 73 | - wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
|
|
| 74 | - wp_enqueue_script('geodirectory-admin');
|
|
| 73 | + wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
|
|
| 74 | + wp_enqueue_script('geodirectory-admin');
|
|
| 75 | 75 | |
| 76 | - } |
|
| 76 | + } |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if (!function_exists('geodir_admin_scripts')) {
|
| 80 | - /** |
|
| 81 | - * Enqueue Admin Scripts. |
|
| 82 | - * |
|
| 83 | - * @since 1.0.0 |
|
| 84 | - * @package GeoDirectory |
|
| 85 | - */ |
|
| 86 | - function geodir_admin_scripts() |
|
| 87 | - {
|
|
| 88 | - $geodir_map_name = geodir_map_name(); |
|
| 80 | + /** |
|
| 81 | + * Enqueue Admin Scripts. |
|
| 82 | + * |
|
| 83 | + * @since 1.0.0 |
|
| 84 | + * @package GeoDirectory |
|
| 85 | + */ |
|
| 86 | + function geodir_admin_scripts() |
|
| 87 | + {
|
|
| 88 | + $geodir_map_name = geodir_map_name(); |
|
| 89 | 89 | |
| 90 | - wp_enqueue_script('jquery');
|
|
| 90 | + wp_enqueue_script('jquery');
|
|
| 91 | 91 | |
| 92 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true);
|
|
| 92 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true);
|
|
| 93 | 93 | |
| 94 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION);
|
|
| 95 | - wp_enqueue_script('chosen');
|
|
| 94 | + wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION);
|
|
| 95 | + wp_enqueue_script('chosen');
|
|
| 96 | 96 | |
| 97 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
|
|
| 98 | - wp_enqueue_script('geodirectory-choose-ajax');
|
|
| 97 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
|
|
| 98 | + wp_enqueue_script('geodirectory-choose-ajax');
|
|
| 99 | 99 | |
| 100 | - if (isset($_REQUEST['listing_type'])) {
|
|
| 101 | - wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
|
|
| 102 | - } |
|
| 100 | + if (isset($_REQUEST['listing_type'])) {
|
|
| 101 | + wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
|
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - wp_enqueue_script('geodirectory-custom-fields-script');
|
|
| 105 | - $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions'; |
|
| 104 | + wp_enqueue_script('geodirectory-custom-fields-script');
|
|
| 105 | + $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions'; |
|
| 106 | 106 | |
| 107 | - wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true);
|
|
| 107 | + wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true);
|
|
| 108 | 108 | |
| 109 | - if (in_array($geodir_map_name, array('auto', 'google'))) {
|
|
| 110 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 111 | - $map_key = "&key=" . geodir_get_map_api_key(); |
|
| 112 | - /** This filter is documented in geodirectory_template_tags.php */ |
|
| 113 | - $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
| 114 | - wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra, '', NULL);
|
|
| 115 | - } |
|
| 109 | + if (in_array($geodir_map_name, array('auto', 'google'))) {
|
|
| 110 | + $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 111 | + $map_key = "&key=" . geodir_get_map_api_key(); |
|
| 112 | + /** This filter is documented in geodirectory_template_tags.php */ |
|
| 113 | + $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
| 114 | + wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra, '', NULL);
|
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - if ($geodir_map_name == 'osm') {
|
|
| 118 | - // Leaflet OpenStreetMap |
|
| 119 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 120 | - wp_enqueue_style('geodirectory-leaflet-style');
|
|
| 117 | + if ($geodir_map_name == 'osm') {
|
|
| 118 | + // Leaflet OpenStreetMap |
|
| 119 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 120 | + wp_enqueue_style('geodirectory-leaflet-style');
|
|
| 121 | 121 | |
| 122 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 123 | - wp_enqueue_script('geodirectory-leaflet-script');
|
|
| 122 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 123 | + wp_enqueue_script('geodirectory-leaflet-script');
|
|
| 124 | 124 | |
| 125 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
|
|
| 126 | - wp_enqueue_script('geodirectory-leaflet-geo-script');
|
|
| 127 | - } |
|
| 128 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 125 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
|
|
| 126 | + wp_enqueue_script('geodirectory-leaflet-geo-script');
|
|
| 127 | + } |
|
| 128 | + wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 129 | 129 | |
| 130 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 131 | - wp_enqueue_script('geodirectory-goMap-script');
|
|
| 130 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 131 | + wp_enqueue_script('geodirectory-goMap-script');
|
|
| 132 | 132 | |
| 133 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
|
|
| 134 | - wp_enqueue_script('geodirectory-goMap-script');
|
|
| 133 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
|
|
| 134 | + wp_enqueue_script('geodirectory-goMap-script');
|
|
| 135 | 135 | |
| 136 | 136 | // font awesome rating script |
| 137 | 137 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
@@ -142,167 +142,167 @@ discard block |
||
| 142 | 142 | wp_enqueue_script('geodir-jRating-js');
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 146 | - wp_enqueue_script('geodir-on-document-load');
|
|
| 147 | - |
|
| 148 | - |
|
| 149 | - // SCRIPT FOR UPLOAD |
|
| 150 | - wp_enqueue_script('plupload-all');
|
|
| 151 | - wp_enqueue_script('jquery-ui-sortable');
|
|
| 152 | - |
|
| 153 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
|
|
| 154 | - wp_enqueue_script('geodirectory-plupload-script');
|
|
| 155 | - |
|
| 156 | - // SCRIPT FOR UPLOAD END |
|
| 157 | - |
|
| 158 | - |
|
| 159 | - // place js config array for plupload |
|
| 160 | - $plupload_init = array( |
|
| 161 | - 'runtimes' => 'html5,silverlight,flash,html4', |
|
| 162 | - 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
| 163 | - 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
| 164 | - 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
| 165 | - 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
| 166 | - 'multiple_queues' => true, |
|
| 167 | - 'max_file_size' => geodir_max_upload_size(), |
|
| 168 | - 'url' => admin_url('admin-ajax.php'),
|
|
| 169 | - 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
| 170 | - 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
| 171 | - 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
|
|
| 172 | - 'multipart' => true, |
|
| 173 | - 'urlstream_upload' => true, |
|
| 174 | - 'multi_selection' => false, // will be added per uploader |
|
| 175 | - // additional post data to send to our ajax hook |
|
| 176 | - 'multipart_params' => array( |
|
| 177 | - '_ajax_nonce' => "", // will be added per uploader |
|
| 178 | - 'action' => 'plupload_action', // the ajax action name |
|
| 179 | - 'imgid' => 0 // will be added per uploader |
|
| 180 | - ) |
|
| 181 | - ); |
|
| 182 | - $base_plupload_config = json_encode($plupload_init); |
|
| 183 | - |
|
| 184 | - |
|
| 185 | - $thumb_img_arr = array(); |
|
| 186 | - |
|
| 187 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 188 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 189 | - |
|
| 190 | - $totImg = ''; |
|
| 191 | - $image_limit = ''; |
|
| 192 | - if (!empty($thumb_img_arr)) {
|
|
| 193 | - $totImg = count($thumb_img_arr); |
|
| 194 | - } |
|
| 145 | + wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 146 | + wp_enqueue_script('geodir-on-document-load');
|
|
| 147 | + |
|
| 148 | + |
|
| 149 | + // SCRIPT FOR UPLOAD |
|
| 150 | + wp_enqueue_script('plupload-all');
|
|
| 151 | + wp_enqueue_script('jquery-ui-sortable');
|
|
| 152 | + |
|
| 153 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
|
|
| 154 | + wp_enqueue_script('geodirectory-plupload-script');
|
|
| 155 | + |
|
| 156 | + // SCRIPT FOR UPLOAD END |
|
| 157 | + |
|
| 158 | + |
|
| 159 | + // place js config array for plupload |
|
| 160 | + $plupload_init = array( |
|
| 161 | + 'runtimes' => 'html5,silverlight,flash,html4', |
|
| 162 | + 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
| 163 | + 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
| 164 | + 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
| 165 | + 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
| 166 | + 'multiple_queues' => true, |
|
| 167 | + 'max_file_size' => geodir_max_upload_size(), |
|
| 168 | + 'url' => admin_url('admin-ajax.php'),
|
|
| 169 | + 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
| 170 | + 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
| 171 | + 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
|
|
| 172 | + 'multipart' => true, |
|
| 173 | + 'urlstream_upload' => true, |
|
| 174 | + 'multi_selection' => false, // will be added per uploader |
|
| 175 | + // additional post data to send to our ajax hook |
|
| 176 | + 'multipart_params' => array( |
|
| 177 | + '_ajax_nonce' => "", // will be added per uploader |
|
| 178 | + 'action' => 'plupload_action', // the ajax action name |
|
| 179 | + 'imgid' => 0 // will be added per uploader |
|
| 180 | + ) |
|
| 181 | + ); |
|
| 182 | + $base_plupload_config = json_encode($plupload_init); |
|
| 183 | + |
|
| 184 | + |
|
| 185 | + $thumb_img_arr = array(); |
|
| 186 | + |
|
| 187 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 188 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 189 | + |
|
| 190 | + $totImg = ''; |
|
| 191 | + $image_limit = ''; |
|
| 192 | + if (!empty($thumb_img_arr)) {
|
|
| 193 | + $totImg = count($thumb_img_arr); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | - $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
|
|
| 197 | - 'totalImg' => $totImg, |
|
| 198 | - 'image_limit' => $image_limit, |
|
| 199 | - 'upload_img_size' => geodir_max_upload_size()); |
|
| 196 | + $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
|
|
| 197 | + 'totalImg' => $totImg, |
|
| 198 | + 'image_limit' => $image_limit, |
|
| 199 | + 'upload_img_size' => geodir_max_upload_size()); |
|
| 200 | 200 | |
| 201 | - wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
| 201 | + wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
| 202 | 202 | |
| 203 | - $ajax_cons_data = array('url' => __(admin_url('admin-ajax.php')));
|
|
| 204 | - wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data);
|
|
| 203 | + $ajax_cons_data = array('url' => __(admin_url('admin-ajax.php')));
|
|
| 204 | + wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data);
|
|
| 205 | 205 | |
| 206 | 206 | |
| 207 | - wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
|
|
| 208 | - wp_enqueue_script('geodirectory-admin-script');
|
|
| 207 | + wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
|
|
| 208 | + wp_enqueue_script('geodirectory-admin-script');
|
|
| 209 | 209 | |
| 210 | - wp_enqueue_style('farbtastic');
|
|
| 211 | - wp_enqueue_script('farbtastic');
|
|
| 210 | + wp_enqueue_style('farbtastic');
|
|
| 211 | + wp_enqueue_script('farbtastic');
|
|
| 212 | 212 | |
| 213 | - $screen = get_current_screen(); |
|
| 214 | - if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) {
|
|
| 215 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js');
|
|
| 216 | - } |
|
| 213 | + $screen = get_current_screen(); |
|
| 214 | + if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) {
|
|
| 215 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js');
|
|
| 216 | + } |
|
| 217 | 217 | |
| 218 | - $ajax_cons_data = array('url' => esc_url(__(get_option('siteurl') . '?geodir_ajax=true')));
|
|
| 219 | - wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data);
|
|
| 218 | + $ajax_cons_data = array('url' => esc_url(__(get_option('siteurl') . '?geodir_ajax=true')));
|
|
| 219 | + wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data);
|
|
| 220 | 220 | |
| 221 | - } |
|
| 221 | + } |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if (!function_exists('geodir_admin_menu')) {
|
| 225 | - /** |
|
| 226 | - * Admin Menus |
|
| 227 | - * |
|
| 228 | - * Sets up the admin menus in wordpress. |
|
| 229 | - * |
|
| 230 | - * @since 1.0.0 |
|
| 231 | - * @package GeoDirectory |
|
| 232 | - * @global array $menu Menu array. |
|
| 233 | - * @global object $geodirectory GeoDirectory plugin object. |
|
| 234 | - */ |
|
| 235 | - function geodir_admin_menu() |
|
| 236 | - {
|
|
| 237 | - global $menu, $geodirectory; |
|
| 225 | + /** |
|
| 226 | + * Admin Menus |
|
| 227 | + * |
|
| 228 | + * Sets up the admin menus in wordpress. |
|
| 229 | + * |
|
| 230 | + * @since 1.0.0 |
|
| 231 | + * @package GeoDirectory |
|
| 232 | + * @global array $menu Menu array. |
|
| 233 | + * @global object $geodirectory GeoDirectory plugin object. |
|
| 234 | + */ |
|
| 235 | + function geodir_admin_menu() |
|
| 236 | + {
|
|
| 237 | + global $menu, $geodirectory; |
|
| 238 | 238 | |
| 239 | - if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory');
|
|
| 239 | + if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory');
|
|
| 240 | 240 | |
| 241 | - add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984');
|
|
| 241 | + add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984');
|
|
| 242 | 242 | |
| 243 | 243 | |
| 244 | - } |
|
| 244 | + } |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | if (!function_exists('geodir_admin_menu_order')) {
|
| 248 | - /** |
|
| 249 | - * Order admin menus. |
|
| 250 | - * |
|
| 251 | - * @since 1.0.0 |
|
| 252 | - * @package GeoDirectory |
|
| 253 | - * @param array $menu_order Menu order array. |
|
| 254 | - * @return array Modified menu order array. |
|
| 255 | - */ |
|
| 256 | - function geodir_admin_menu_order($menu_order) |
|
| 257 | - {
|
|
| 258 | - |
|
| 259 | - // Initialize our custom order array |
|
| 260 | - $geodir_menu_order = array(); |
|
| 261 | - |
|
| 262 | - // Get the index of our custom separator |
|
| 263 | - $geodir_separator = array_search('separator-geodirectory', $menu_order);
|
|
| 264 | - |
|
| 265 | - // Get index of posttype menu |
|
| 266 | - $post_types = geodir_get_posttypes(); |
|
| 267 | - |
|
| 268 | - // Loop through menu order and do some rearranging |
|
| 269 | - foreach ($menu_order as $index => $item) : |
|
| 270 | - |
|
| 271 | - if ((('geodirectory') == $item)) :
|
|
| 272 | - $geodir_menu_order[] = 'separator-geodirectory'; |
|
| 273 | - if (!empty($post_types)) {
|
|
| 274 | - foreach ($post_types as $post_type) {
|
|
| 275 | - $geodir_menu_order[] = 'edit.php?post_type=' . $post_type; |
|
| 276 | - } |
|
| 277 | - } |
|
| 278 | - $geodir_menu_order[] = $item; |
|
| 248 | + /** |
|
| 249 | + * Order admin menus. |
|
| 250 | + * |
|
| 251 | + * @since 1.0.0 |
|
| 252 | + * @package GeoDirectory |
|
| 253 | + * @param array $menu_order Menu order array. |
|
| 254 | + * @return array Modified menu order array. |
|
| 255 | + */ |
|
| 256 | + function geodir_admin_menu_order($menu_order) |
|
| 257 | + {
|
|
| 279 | 258 | |
| 280 | - unset($menu_order[$geodir_separator]); |
|
| 281 | - //unset( $menu_order[$geodir_places] ); |
|
| 282 | - elseif (!in_array($item, array('separator-geodirectory'))) :
|
|
| 283 | - $geodir_menu_order[] = $item; |
|
| 284 | - endif; |
|
| 259 | + // Initialize our custom order array |
|
| 260 | + $geodir_menu_order = array(); |
|
| 285 | 261 | |
| 286 | - endforeach; |
|
| 262 | + // Get the index of our custom separator |
|
| 263 | + $geodir_separator = array_search('separator-geodirectory', $menu_order);
|
|
| 287 | 264 | |
| 288 | - // Return order |
|
| 289 | - return $geodir_menu_order; |
|
| 290 | - } |
|
| 265 | + // Get index of posttype menu |
|
| 266 | + $post_types = geodir_get_posttypes(); |
|
| 267 | + |
|
| 268 | + // Loop through menu order and do some rearranging |
|
| 269 | + foreach ($menu_order as $index => $item) : |
|
| 270 | + |
|
| 271 | + if ((('geodirectory') == $item)) :
|
|
| 272 | + $geodir_menu_order[] = 'separator-geodirectory'; |
|
| 273 | + if (!empty($post_types)) {
|
|
| 274 | + foreach ($post_types as $post_type) {
|
|
| 275 | + $geodir_menu_order[] = 'edit.php?post_type=' . $post_type; |
|
| 276 | + } |
|
| 277 | + } |
|
| 278 | + $geodir_menu_order[] = $item; |
|
| 279 | + |
|
| 280 | + unset($menu_order[$geodir_separator]); |
|
| 281 | + //unset( $menu_order[$geodir_places] ); |
|
| 282 | + elseif (!in_array($item, array('separator-geodirectory'))) :
|
|
| 283 | + $geodir_menu_order[] = $item; |
|
| 284 | + endif; |
|
| 285 | + |
|
| 286 | + endforeach; |
|
| 287 | + |
|
| 288 | + // Return order |
|
| 289 | + return $geodir_menu_order; |
|
| 290 | + } |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | if (!function_exists('geodir_admin_custom_menu_order')) {
|
| 294 | - /** |
|
| 295 | - * Enables custom menu order. |
|
| 296 | - * |
|
| 297 | - * @since 1.0.0 |
|
| 298 | - * @package GeoDirectory |
|
| 299 | - * @return bool |
|
| 300 | - */ |
|
| 301 | - function geodir_admin_custom_menu_order() |
|
| 302 | - {
|
|
| 303 | - if (!current_user_can('manage_options')) return false;
|
|
| 304 | - return true; |
|
| 305 | - } |
|
| 294 | + /** |
|
| 295 | + * Enables custom menu order. |
|
| 296 | + * |
|
| 297 | + * @since 1.0.0 |
|
| 298 | + * @package GeoDirectory |
|
| 299 | + * @return bool |
|
| 300 | + */ |
|
| 301 | + function geodir_admin_custom_menu_order() |
|
| 302 | + {
|
|
| 303 | + if (!current_user_can('manage_options')) return false;
|
|
| 304 | + return true; |
|
| 305 | + } |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** |
@@ -313,51 +313,51 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | function geodir_before_admin_panel() |
| 315 | 315 | {
|
| 316 | - if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') {
|
|
| 317 | - echo '<div id="message" class="updated fade"> |
|
| 316 | + if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') {
|
|
| 317 | + echo '<div id="message" class="updated fade"> |
|
| 318 | 318 | <p style="float:right;">' . __('Like Geodirectory?', 'geodirectory') . ' <a href="http://wordpress.org/extend/plugins/Geodirectory/" target="_blank">' . __('Support us by leaving a rating!', 'geodirectory') . '</a></p>
|
| 319 | 319 | <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory') . '</strong></p>
|
| 320 | 320 | </div>'; |
| 321 | 321 | |
| 322 | - } |
|
| 322 | + } |
|
| 323 | 323 | |
| 324 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') {
|
|
| 325 | - switch ($_REQUEST['msg']) {
|
|
| 326 | - case 'success': |
|
| 327 | - echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>';
|
|
| 328 | - flush_rewrite_rules(false); |
|
| 324 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') {
|
|
| 325 | + switch ($_REQUEST['msg']) {
|
|
| 326 | + case 'success': |
|
| 327 | + echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>';
|
|
| 328 | + flush_rewrite_rules(false); |
|
| 329 | 329 | |
| 330 | - break; |
|
| 330 | + break; |
|
| 331 | 331 | case 'fail': |
| 332 | 332 | $gderr = isset($_REQUEST['gderr']) ? $_REQUEST['gderr'] : ''; |
| 333 | 333 | |
| 334 | 334 | if ($gderr == 21) |
| 335 | - echo '<div id="message" class="error fade"><p><strong>' . __('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory') . '</strong></p></div>';
|
|
| 335 | + echo '<div id="message" class="error fade"><p><strong>' . __('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory') . '</strong></p></div>';
|
|
| 336 | 336 | else |
| 337 | 337 | echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>';
|
| 338 | - break; |
|
| 339 | - } |
|
| 340 | - } |
|
| 338 | + break; |
|
| 339 | + } |
|
| 340 | + } |
|
| 341 | 341 | |
| 342 | - $geodir_load_map = get_option('geodir_load_map');
|
|
| 343 | - $need_map_key = false; |
|
| 344 | - if($geodir_load_map=='' || $geodir_load_map=='google' || $geodir_load_map=='auto' ){
|
|
| 345 | - $need_map_key = true; |
|
| 346 | - } |
|
| 342 | + $geodir_load_map = get_option('geodir_load_map');
|
|
| 343 | + $need_map_key = false; |
|
| 344 | + if($geodir_load_map=='' || $geodir_load_map=='google' || $geodir_load_map=='auto' ){
|
|
| 345 | + $need_map_key = true; |
|
| 346 | + } |
|
| 347 | 347 | |
| 348 | - if (!geodir_get_map_api_key() && $need_map_key) {
|
|
| 349 | - echo '<div class="error"><p><strong>' . sprintf(__('Google Maps API KEY not set, %sclick here%s to set one OR use Open Street Maps instead.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_map_settings') . '\'>', '</a>') . '</strong></p></div>';
|
|
| 350 | - } |
|
| 348 | + if (!geodir_get_map_api_key() && $need_map_key) {
|
|
| 349 | + echo '<div class="error"><p><strong>' . sprintf(__('Google Maps API KEY not set, %sclick here%s to set one OR use Open Street Maps instead.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_map_settings') . '\'>', '</a>') . '</strong></p></div>';
|
|
| 350 | + } |
|
| 351 | 351 | |
| 352 | - if (!geodir_is_default_location_set()) {
|
|
| 353 | - echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
|
|
| 352 | + if (!geodir_is_default_location_set()) {
|
|
| 353 | + echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
|
|
| 354 | 354 | |
| 355 | - } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | - if (!function_exists('curl_init')) {
|
|
| 358 | - echo '<div class="error"><p><strong>' . __('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory') . '</strong></p></div>';
|
|
| 357 | + if (!function_exists('curl_init')) {
|
|
| 358 | + echo '<div class="error"><p><strong>' . __('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory') . '</strong></p></div>';
|
|
| 359 | 359 | |
| 360 | - } |
|
| 360 | + } |
|
| 361 | 361 | |
| 362 | 362 | |
| 363 | 363 | |
@@ -374,19 +374,19 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function geodir_handle_option_form_submit($current_tab) |
| 376 | 376 | {
|
| 377 | - global $geodir_settings; |
|
| 378 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) {
|
|
| 379 | - /** |
|
| 380 | - * Contains settings array for current tab. |
|
| 381 | - * |
|
| 382 | - * @since 1.0.0 |
|
| 383 | - * @package GeoDirectory |
|
| 384 | - */ |
|
| 385 | - include_once('option-pages/' . $current_tab . '_array.php');
|
|
| 386 | - } |
|
| 387 | - if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') : |
|
| 388 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
|
|
| 389 | - if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
|
|
| 377 | + global $geodir_settings; |
|
| 378 | + if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) {
|
|
| 379 | + /** |
|
| 380 | + * Contains settings array for current tab. |
|
| 381 | + * |
|
| 382 | + * @since 1.0.0 |
|
| 383 | + * @package GeoDirectory |
|
| 384 | + */ |
|
| 385 | + include_once('option-pages/' . $current_tab . '_array.php');
|
|
| 386 | + } |
|
| 387 | + if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') : |
|
| 388 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
|
|
| 389 | + if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
|
|
| 390 | 390 | |
| 391 | 391 | /** |
| 392 | 392 | * Fires before updating geodirectory admin settings. |
@@ -398,38 +398,38 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | do_action('geodir_before_update_options', $current_tab, $geodir_settings);
|
| 400 | 400 | |
| 401 | - if (!empty($geodir_settings[$current_tab])) |
|
| 402 | - geodir_update_options($geodir_settings[$current_tab]); |
|
| 401 | + if (!empty($geodir_settings[$current_tab])) |
|
| 402 | + geodir_update_options($geodir_settings[$current_tab]); |
|
| 403 | 403 | |
| 404 | - /** |
|
| 405 | - * Called after GeoDirectory options settings are updated. |
|
| 406 | - * |
|
| 407 | - * @since 1.0.0 |
|
| 408 | - * @param array $geodir_settings The array of GeoDirectory settings. |
|
| 409 | - * @see 'geodir_before_update_options' |
|
| 410 | - */ |
|
| 411 | - do_action('geodir_update_options', $geodir_settings);
|
|
| 404 | + /** |
|
| 405 | + * Called after GeoDirectory options settings are updated. |
|
| 406 | + * |
|
| 407 | + * @since 1.0.0 |
|
| 408 | + * @param array $geodir_settings The array of GeoDirectory settings. |
|
| 409 | + * @see 'geodir_before_update_options' |
|
| 410 | + */ |
|
| 411 | + do_action('geodir_update_options', $geodir_settings);
|
|
| 412 | 412 | |
| 413 | - /** |
|
| 414 | - * Called after GeoDirectory options settings are updated. |
|
| 415 | - * |
|
| 416 | - * Provides tab specific settings. |
|
| 417 | - * |
|
| 418 | - * @since 1.0.0 |
|
| 419 | - * @param string $current_tab The current settings tab name. |
|
| 420 | - * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab. |
|
| 421 | - */ |
|
| 422 | - do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]);
|
|
| 413 | + /** |
|
| 414 | + * Called after GeoDirectory options settings are updated. |
|
| 415 | + * |
|
| 416 | + * Provides tab specific settings. |
|
| 417 | + * |
|
| 418 | + * @since 1.0.0 |
|
| 419 | + * @param string $current_tab The current settings tab name. |
|
| 420 | + * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab. |
|
| 421 | + */ |
|
| 422 | + do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]);
|
|
| 423 | 423 | |
| 424 | - flush_rewrite_rules(false); |
|
| 424 | + flush_rewrite_rules(false); |
|
| 425 | 425 | |
| 426 | - $current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : ''; |
|
| 426 | + $current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : ''; |
|
| 427 | 427 | |
| 428 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success');
|
|
| 428 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success');
|
|
| 429 | 429 | |
| 430 | - wp_redirect($redirect_url); |
|
| 431 | - exit(); |
|
| 432 | - endif; |
|
| 430 | + wp_redirect($redirect_url); |
|
| 431 | + exit(); |
|
| 432 | + endif; |
|
| 433 | 433 | |
| 434 | 434 | |
| 435 | 435 | } |
@@ -447,144 +447,144 @@ discard block |
||
| 447 | 447 | * @return bool Returns true if saved. |
| 448 | 448 | */ |
| 449 | 449 | function geodir_update_options($options, $dummy = false) {
|
| 450 | - if ((!isset($_POST) || !$_POST) && !$dummy) return false; |
|
| 450 | + if ((!isset($_POST) || !$_POST) && !$dummy) return false; |
|
| 451 | 451 | |
| 452 | - foreach ($options as $value) {
|
|
| 453 | - if ($dummy && isset($value['std'])) |
|
| 454 | - $_POST[$value['id']] = $value['std']; |
|
| 452 | + foreach ($options as $value) {
|
|
| 453 | + if ($dummy && isset($value['std'])) |
|
| 454 | + $_POST[$value['id']] = $value['std']; |
|
| 455 | 455 | |
| 456 | 456 | |
| 457 | - if (isset($value['type']) && $value['type'] == 'checkbox') : |
|
| 457 | + if (isset($value['type']) && $value['type'] == 'checkbox') : |
|
| 458 | 458 | |
| 459 | - if (isset($value['id']) && isset($_POST[$value['id']])) {
|
|
| 460 | - update_option($value['id'], $_POST[$value['id']]); |
|
| 461 | - } else {
|
|
| 462 | - update_option($value['id'], 0); |
|
| 463 | - } |
|
| 459 | + if (isset($value['id']) && isset($_POST[$value['id']])) {
|
|
| 460 | + update_option($value['id'], $_POST[$value['id']]); |
|
| 461 | + } else {
|
|
| 462 | + update_option($value['id'], 0); |
|
| 463 | + } |
|
| 464 | 464 | |
| 465 | - elseif (isset($value['type']) && $value['type'] == 'image_width') : |
|
| 465 | + elseif (isset($value['type']) && $value['type'] == 'image_width') : |
|
| 466 | 466 | |
| 467 | - if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) {
|
|
| 468 | - update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']); |
|
| 469 | - update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']); |
|
| 470 | - if (isset($_POST[$value['id'] . '_crop'])) : |
|
| 471 | - update_option($value['id'] . '_crop', 1); |
|
| 472 | - else : |
|
| 473 | - update_option($value['id'] . '_crop', 0); |
|
| 474 | - endif; |
|
| 475 | - } else {
|
|
| 476 | - update_option($value['id'] . '_width', $value['std']); |
|
| 477 | - update_option($value['id'] . '_height', $value['std']); |
|
| 478 | - update_option($value['id'] . '_crop', 1); |
|
| 479 | - } |
|
| 467 | + if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) {
|
|
| 468 | + update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']); |
|
| 469 | + update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']); |
|
| 470 | + if (isset($_POST[$value['id'] . '_crop'])) : |
|
| 471 | + update_option($value['id'] . '_crop', 1); |
|
| 472 | + else : |
|
| 473 | + update_option($value['id'] . '_crop', 0); |
|
| 474 | + endif; |
|
| 475 | + } else {
|
|
| 476 | + update_option($value['id'] . '_width', $value['std']); |
|
| 477 | + update_option($value['id'] . '_height', $value['std']); |
|
| 478 | + update_option($value['id'] . '_crop', 1); |
|
| 479 | + } |
|
| 480 | 480 | |
| 481 | - elseif (isset($value['type']) && $value['type'] == 'map') : |
|
| 482 | - $post_types = array(); |
|
| 483 | - $categories = array(); |
|
| 481 | + elseif (isset($value['type']) && $value['type'] == 'map') : |
|
| 482 | + $post_types = array(); |
|
| 483 | + $categories = array(); |
|
| 484 | 484 | |
| 485 | - if (!empty($_POST['home_map_post_types'])) : |
|
| 486 | - foreach ($_POST['home_map_post_types'] as $post_type) : |
|
| 487 | - $post_types[] = $post_type; |
|
| 488 | - endforeach; |
|
| 489 | - endif; |
|
| 485 | + if (!empty($_POST['home_map_post_types'])) : |
|
| 486 | + foreach ($_POST['home_map_post_types'] as $post_type) : |
|
| 487 | + $post_types[] = $post_type; |
|
| 488 | + endforeach; |
|
| 489 | + endif; |
|
| 490 | 490 | |
| 491 | - update_option('geodir_exclude_post_type_on_map', $post_types);
|
|
| 491 | + update_option('geodir_exclude_post_type_on_map', $post_types);
|
|
| 492 | 492 | |
| 493 | - if (!empty($_POST['post_category'])) : |
|
| 494 | - foreach ($_POST['post_category'] as $texonomy => $cat_arr) : |
|
| 495 | - $categories[$texonomy] = array(); |
|
| 496 | - foreach ($cat_arr as $category) : |
|
| 497 | - $categories[$texonomy][] = $category; |
|
| 498 | - endforeach; |
|
| 499 | - $categories[$texonomy] = !empty($categories[$texonomy]) ? array_unique($categories[$texonomy]) : array(); |
|
| 500 | - endforeach; |
|
| 501 | - endif; |
|
| 502 | - update_option('geodir_exclude_cat_on_map', $categories);
|
|
| 503 | - update_option('geodir_exclude_cat_on_map_upgrade', 1);
|
|
| 504 | - elseif (isset($value['type']) && $value['type'] == 'map_default_settings') : |
|
| 493 | + if (!empty($_POST['post_category'])) : |
|
| 494 | + foreach ($_POST['post_category'] as $texonomy => $cat_arr) : |
|
| 495 | + $categories[$texonomy] = array(); |
|
| 496 | + foreach ($cat_arr as $category) : |
|
| 497 | + $categories[$texonomy][] = $category; |
|
| 498 | + endforeach; |
|
| 499 | + $categories[$texonomy] = !empty($categories[$texonomy]) ? array_unique($categories[$texonomy]) : array(); |
|
| 500 | + endforeach; |
|
| 501 | + endif; |
|
| 502 | + update_option('geodir_exclude_cat_on_map', $categories);
|
|
| 503 | + update_option('geodir_exclude_cat_on_map_upgrade', 1);
|
|
| 504 | + elseif (isset($value['type']) && $value['type'] == 'map_default_settings') : |
|
| 505 | 505 | |
| 506 | 506 | |
| 507 | - if (!empty($_POST['geodir_default_map_language'])): |
|
| 508 | - update_option('geodir_default_map_language', $_POST['geodir_default_map_language']);
|
|
| 509 | - endif; |
|
| 507 | + if (!empty($_POST['geodir_default_map_language'])): |
|
| 508 | + update_option('geodir_default_map_language', $_POST['geodir_default_map_language']);
|
|
| 509 | + endif; |
|
| 510 | 510 | |
| 511 | 511 | |
| 512 | - if (!empty($_POST['geodir_default_map_search_pt'])): |
|
| 513 | - update_option('geodir_default_map_search_pt', $_POST['geodir_default_map_search_pt']);
|
|
| 514 | - endif; |
|
| 512 | + if (!empty($_POST['geodir_default_map_search_pt'])): |
|
| 513 | + update_option('geodir_default_map_search_pt', $_POST['geodir_default_map_search_pt']);
|
|
| 514 | + endif; |
|
| 515 | 515 | |
| 516 | 516 | |
| 517 | - elseif (isset($value['type']) && $value['type'] == 'file') : |
|
| 517 | + elseif (isset($value['type']) && $value['type'] == 'file') : |
|
| 518 | 518 | |
| 519 | 519 | |
| 520 | - if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file
|
|
| 520 | + if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file
|
|
| 521 | 521 | |
| 522 | - if (get_option($value['id'])) {
|
|
| 523 | - $image_name_arr = explode('/', get_option($value['id']));
|
|
| 524 | - $noimg_name = end($image_name_arr); |
|
| 525 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
| 526 | - if (file_exists($img_path)) |
|
| 527 | - unlink($img_path); |
|
| 528 | - } |
|
| 522 | + if (get_option($value['id'])) {
|
|
| 523 | + $image_name_arr = explode('/', get_option($value['id']));
|
|
| 524 | + $noimg_name = end($image_name_arr); |
|
| 525 | + $img_path = $uploads['path'] . '/' . $noimg_name; |
|
| 526 | + if (file_exists($img_path)) |
|
| 527 | + unlink($img_path); |
|
| 528 | + } |
|
| 529 | 529 | |
| 530 | - update_option($value['id'], ''); |
|
| 531 | - } |
|
| 530 | + update_option($value['id'], ''); |
|
| 531 | + } |
|
| 532 | 532 | |
| 533 | - $uploadedfile = isset($_FILES[$value['id']]) ? $_FILES[$value['id']] : ''; |
|
| 534 | - $filename = isset($_FILES[$value['id']]['name']) ? $_FILES[$value['id']]['name'] : ''; |
|
| 535 | - |
|
| 536 | - if (!empty($filename)): |
|
| 537 | - $ext = pathinfo($filename, PATHINFO_EXTENSION); |
|
| 538 | - $uplaods = array(); |
|
| 539 | - |
|
| 540 | - foreach ($uploadedfile as $key => $uplaod): |
|
| 541 | - if ($key == 'name'): |
|
| 542 | - $uplaods[$key] = $filename; |
|
| 543 | - else : |
|
| 544 | - $uplaods[$key] = $uplaod; |
|
| 545 | - endif; |
|
| 546 | - endforeach; |
|
| 547 | - |
|
| 548 | - $uploads = wp_upload_dir(); |
|
| 549 | - |
|
| 550 | - if (get_option($value['id'])) {
|
|
| 551 | - $image_name_arr = explode('/', get_option($value['id']));
|
|
| 552 | - $noimg_name = end($image_name_arr); |
|
| 553 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
| 554 | - if (file_exists($img_path)) |
|
| 555 | - unlink($img_path); |
|
| 556 | - } |
|
| 533 | + $uploadedfile = isset($_FILES[$value['id']]) ? $_FILES[$value['id']] : ''; |
|
| 534 | + $filename = isset($_FILES[$value['id']]['name']) ? $_FILES[$value['id']]['name'] : ''; |
|
| 535 | + |
|
| 536 | + if (!empty($filename)): |
|
| 537 | + $ext = pathinfo($filename, PATHINFO_EXTENSION); |
|
| 538 | + $uplaods = array(); |
|
| 539 | + |
|
| 540 | + foreach ($uploadedfile as $key => $uplaod): |
|
| 541 | + if ($key == 'name'): |
|
| 542 | + $uplaods[$key] = $filename; |
|
| 543 | + else : |
|
| 544 | + $uplaods[$key] = $uplaod; |
|
| 545 | + endif; |
|
| 546 | + endforeach; |
|
| 547 | + |
|
| 548 | + $uploads = wp_upload_dir(); |
|
| 549 | + |
|
| 550 | + if (get_option($value['id'])) {
|
|
| 551 | + $image_name_arr = explode('/', get_option($value['id']));
|
|
| 552 | + $noimg_name = end($image_name_arr); |
|
| 553 | + $img_path = $uploads['path'] . '/' . $noimg_name; |
|
| 554 | + if (file_exists($img_path)) |
|
| 555 | + unlink($img_path); |
|
| 556 | + } |
|
| 557 | 557 | |
| 558 | - $upload_overrides = array('test_form' => false);
|
|
| 559 | - $movefile = wp_handle_upload($uplaods, $upload_overrides); |
|
| 558 | + $upload_overrides = array('test_form' => false);
|
|
| 559 | + $movefile = wp_handle_upload($uplaods, $upload_overrides); |
|
| 560 | 560 | |
| 561 | - update_option($value['id'], $movefile['url']); |
|
| 561 | + update_option($value['id'], $movefile['url']); |
|
| 562 | 562 | |
| 563 | - endif; |
|
| 563 | + endif; |
|
| 564 | 564 | |
| 565 | - if (!get_option($value['id']) && isset($value['value'])): |
|
| 566 | - update_option($value['id'], $value['value']); |
|
| 567 | - endif; |
|
| 565 | + if (!get_option($value['id']) && isset($value['value'])): |
|
| 566 | + update_option($value['id'], $value['value']); |
|
| 567 | + endif; |
|
| 568 | 568 | |
| 569 | 569 | |
| 570 | - else : |
|
| 571 | - // same menu setting per theme. |
|
| 572 | - if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
|
|
| 573 | - $theme = wp_get_theme(); |
|
| 574 | - update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
|
|
| 575 | - } |
|
| 570 | + else : |
|
| 571 | + // same menu setting per theme. |
|
| 572 | + if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
|
|
| 573 | + $theme = wp_get_theme(); |
|
| 574 | + update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
|
|
| 575 | + } |
|
| 576 | 576 | |
| 577 | - if (isset($value['id']) && isset($_POST[$value['id']])) {
|
|
| 578 | - update_option($value['id'], $_POST[$value['id']]); |
|
| 579 | - } else {
|
|
| 580 | - delete_option($value['id']); |
|
| 581 | - } |
|
| 577 | + if (isset($value['id']) && isset($_POST[$value['id']])) {
|
|
| 578 | + update_option($value['id'], $_POST[$value['id']]); |
|
| 579 | + } else {
|
|
| 580 | + delete_option($value['id']); |
|
| 581 | + } |
|
| 582 | 582 | |
| 583 | - endif; |
|
| 584 | - } |
|
| 585 | - if ($dummy) |
|
| 586 | - $_POST = array(); |
|
| 587 | - return true; |
|
| 583 | + endif; |
|
| 584 | + } |
|
| 585 | + if ($dummy) |
|
| 586 | + $_POST = array(); |
|
| 587 | + return true; |
|
| 588 | 588 | |
| 589 | 589 | } |
| 590 | 590 | |
@@ -633,33 +633,33 @@ discard block |
||
| 633 | 633 | function places_custom_fields_tab($tabs) |
| 634 | 634 | {
|
| 635 | 635 | |
| 636 | - $geodir_post_types = get_option('geodir_post_types');
|
|
| 636 | + $geodir_post_types = get_option('geodir_post_types');
|
|
| 637 | 637 | |
| 638 | - if (!empty($geodir_post_types)) {
|
|
| 638 | + if (!empty($geodir_post_types)) {
|
|
| 639 | 639 | |
| 640 | - foreach ($geodir_post_types as $geodir_post_type => $geodir_posttype_info): |
|
| 640 | + foreach ($geodir_post_types as $geodir_post_type => $geodir_posttype_info): |
|
| 641 | 641 | |
| 642 | - $listing_slug = $geodir_posttype_info['labels']['singular_name']; |
|
| 642 | + $listing_slug = $geodir_posttype_info['labels']['singular_name']; |
|
| 643 | 643 | |
| 644 | - $tabs[$geodir_post_type . '_fields_settings'] = array( |
|
| 645 | - 'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'), |
|
| 646 | - 'subtabs' => array( |
|
| 647 | - array('subtab' => 'custom_fields',
|
|
| 648 | - 'label' => __('Custom Fields', 'geodirectory'),
|
|
| 649 | - 'request' => array('listing_type' => $geodir_post_type)),
|
|
| 650 | - array('subtab' => 'sorting_options',
|
|
| 651 | - 'label' => __('Sorting Options', 'geodirectory'),
|
|
| 652 | - 'request' => array('listing_type' => $geodir_post_type)),
|
|
| 653 | - ), |
|
| 654 | - 'tab_index' => 9, |
|
| 655 | - 'request' => array('listing_type' => $geodir_post_type)
|
|
| 656 | - ); |
|
| 644 | + $tabs[$geodir_post_type . '_fields_settings'] = array( |
|
| 645 | + 'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'), |
|
| 646 | + 'subtabs' => array( |
|
| 647 | + array('subtab' => 'custom_fields',
|
|
| 648 | + 'label' => __('Custom Fields', 'geodirectory'),
|
|
| 649 | + 'request' => array('listing_type' => $geodir_post_type)),
|
|
| 650 | + array('subtab' => 'sorting_options',
|
|
| 651 | + 'label' => __('Sorting Options', 'geodirectory'),
|
|
| 652 | + 'request' => array('listing_type' => $geodir_post_type)),
|
|
| 653 | + ), |
|
| 654 | + 'tab_index' => 9, |
|
| 655 | + 'request' => array('listing_type' => $geodir_post_type)
|
|
| 656 | + ); |
|
| 657 | 657 | |
| 658 | - endforeach; |
|
| 658 | + endforeach; |
|
| 659 | 659 | |
| 660 | - } |
|
| 660 | + } |
|
| 661 | 661 | |
| 662 | - return $tabs; |
|
| 662 | + return $tabs; |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | |
@@ -675,9 +675,9 @@ discard block |
||
| 675 | 675 | */ |
| 676 | 676 | function geodir_tools_setting_tab($tabs) |
| 677 | 677 | {
|
| 678 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
| 679 | - $tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory'));
|
|
| 680 | - return $tabs; |
|
| 678 | + wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
| 679 | + $tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory'));
|
|
| 680 | + return $tabs; |
|
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | /** |
@@ -692,8 +692,8 @@ discard block |
||
| 692 | 692 | */ |
| 693 | 693 | function geodir_compatibility_setting_tab($tabs) |
| 694 | 694 | {
|
| 695 | - $tabs['compatibility_settings'] = array('label' => __('Theme Compatibility', 'geodirectory'));
|
|
| 696 | - return $tabs; |
|
| 695 | + $tabs['compatibility_settings'] = array('label' => __('Theme Compatibility', 'geodirectory'));
|
|
| 696 | + return $tabs; |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | |
@@ -709,144 +709,144 @@ discard block |
||
| 709 | 709 | */ |
| 710 | 710 | function geodir_extend_geodirectory_setting_tab($tabs) |
| 711 | 711 | {
|
| 712 | - $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'https://wpgeodirectory.com', 'target' => '_blank');
|
|
| 713 | - return $tabs; |
|
| 712 | + $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'https://wpgeodirectory.com', 'target' => '_blank');
|
|
| 713 | + return $tabs; |
|
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | |
| 717 | 717 | if (!function_exists('geodir_edit_post_columns')) {
|
| 718 | - /** |
|
| 719 | - * Modify admin post listing page columns. |
|
| 720 | - * |
|
| 721 | - * @since 1.0.0 |
|
| 722 | - * @package GeoDirectory |
|
| 723 | - * @param array $columns The column array. |
|
| 724 | - * @return array Altered column array. |
|
| 725 | - */ |
|
| 726 | - function geodir_edit_post_columns($columns) |
|
| 727 | - {
|
|
| 728 | - |
|
| 729 | - $new_columns = array('location' => __('Location (ID)', 'geodirectory'),
|
|
| 730 | - 'categorys' => __('Categories', 'geodirectory'));
|
|
| 731 | - |
|
| 732 | - if (($offset = array_search('author', array_keys($columns))) === false) // if the key doesn't exist
|
|
| 733 | - {
|
|
| 734 | - $offset = 0; // should we prepend $array with $data? |
|
| 735 | - $offset = count($columns); // or should we append $array with $data? lets pick this one... |
|
| 736 | - } |
|
| 718 | + /** |
|
| 719 | + * Modify admin post listing page columns. |
|
| 720 | + * |
|
| 721 | + * @since 1.0.0 |
|
| 722 | + * @package GeoDirectory |
|
| 723 | + * @param array $columns The column array. |
|
| 724 | + * @return array Altered column array. |
|
| 725 | + */ |
|
| 726 | + function geodir_edit_post_columns($columns) |
|
| 727 | + {
|
|
| 728 | + |
|
| 729 | + $new_columns = array('location' => __('Location (ID)', 'geodirectory'),
|
|
| 730 | + 'categorys' => __('Categories', 'geodirectory'));
|
|
| 737 | 731 | |
| 738 | - $columns = array_merge(array_slice($columns, 0, $offset), $new_columns, array_slice($columns, $offset)); |
|
| 732 | + if (($offset = array_search('author', array_keys($columns))) === false) // if the key doesn't exist
|
|
| 733 | + {
|
|
| 734 | + $offset = 0; // should we prepend $array with $data? |
|
| 735 | + $offset = count($columns); // or should we append $array with $data? lets pick this one... |
|
| 736 | + } |
|
| 739 | 737 | |
| 740 | - $columns = array_merge($columns, array('expire' => __('Expires', 'geodirectory')));
|
|
| 738 | + $columns = array_merge(array_slice($columns, 0, $offset), $new_columns, array_slice($columns, $offset)); |
|
| 741 | 739 | |
| 742 | - return $columns; |
|
| 743 | - } |
|
| 740 | + $columns = array_merge($columns, array('expire' => __('Expires', 'geodirectory')));
|
|
| 741 | + |
|
| 742 | + return $columns; |
|
| 743 | + } |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | |
| 747 | 747 | if (!function_exists('geodir_manage_post_columns')) {
|
| 748 | - /** |
|
| 749 | - * Adds content to our custom post listing page columns. |
|
| 750 | - * |
|
| 751 | - * @since 1.0.0 |
|
| 752 | - * @package GeoDirectory |
|
| 753 | - * @global object $wpdb WordPress Database object. |
|
| 754 | - * @global object $post WordPress Post object. |
|
| 755 | - * @param string $column The column name. |
|
| 756 | - * @param int $post_id The post ID. |
|
| 757 | - */ |
|
| 758 | - function geodir_manage_post_columns($column, $post_id) |
|
| 759 | - {
|
|
| 760 | - global $post, $wpdb; |
|
| 761 | - |
|
| 762 | - switch ($column): |
|
| 763 | - /* If displaying the 'city' column. */ |
|
| 764 | - case 'location' : |
|
| 765 | - $location_id = geodir_get_post_meta($post->ID, 'post_location_id', true); |
|
| 766 | - $location = geodir_get_location($location_id); |
|
| 767 | - /* If no city is found, output a default message. */ |
|
| 768 | - if (empty($location)) {
|
|
| 769 | - _e('Unknown', 'geodirectory');
|
|
| 770 | - } else {
|
|
| 771 | - /* If there is a city id, append 'city name' to the text string. */ |
|
| 772 | - $add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : '';
|
|
| 773 | - echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id); |
|
| 774 | - } |
|
| 775 | - break; |
|
| 776 | - |
|
| 777 | - /* If displaying the 'expire' column. */ |
|
| 778 | - case 'expire' : |
|
| 779 | - $expire_date = geodir_get_post_meta($post->ID, 'expire_date', true); |
|
| 780 | - $d1 = $expire_date; // get expire_date |
|
| 781 | - $d2 = date('Y-m-d'); // get current date
|
|
| 782 | - $state = __('days left', 'geodirectory');
|
|
| 783 | - $date_diff_text = ''; |
|
| 784 | - $expire_class = 'expire_left'; |
|
| 785 | - if ($expire_date != 'Never') {
|
|
| 786 | - if (strtotime($d1) < strtotime($d2)) {
|
|
| 787 | - $state = __('days overdue', 'geodirectory');
|
|
| 788 | - $expire_class = 'expire_over'; |
|
| 789 | - } |
|
| 790 | - $date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days |
|
| 791 | - $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>';
|
|
| 792 | - } |
|
| 793 | - /* If no expire_date is found, output a default message. */ |
|
| 794 | - if (empty($expire_date)) |
|
| 795 | - echo __('Unknown', 'geodirectory');
|
|
| 796 | - /* If there is a expire_date, append 'days left' to the text string. */ |
|
| 797 | - else |
|
| 798 | - echo $expire_date . $date_diff_text; |
|
| 799 | - break; |
|
| 800 | - |
|
| 801 | - /* If displaying the 'categorys' column. */ |
|
| 802 | - case 'categorys' : |
|
| 803 | - |
|
| 804 | - /* Get the categorys for the post. */ |
|
| 805 | - |
|
| 806 | - |
|
| 807 | - $terms = wp_get_object_terms($post_id, get_object_taxonomies($post)); |
|
| 808 | - |
|
| 809 | - /* If terms were found. */ |
|
| 810 | - if (!empty($terms)) {
|
|
| 811 | - $out = array(); |
|
| 812 | - /* Loop through each term, linking to the 'edit posts' page for the specific term. */ |
|
| 813 | - foreach ($terms as $term) {
|
|
| 814 | - if (!strstr($term->taxonomy, 'tag')) {
|
|
| 815 | - $out[] = sprintf('<a href="%s">%s</a>',
|
|
| 816 | - esc_url(add_query_arg(array('post_type' => $post->post_type, $term->taxonomy => $term->slug), 'edit.php')),
|
|
| 817 | - esc_html(sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'display'))
|
|
| 818 | - ); |
|
| 819 | - } |
|
| 820 | - } |
|
| 821 | - /* Join the terms, separating them with a comma. */ |
|
| 822 | - echo(join(', ', $out));
|
|
| 823 | - } /* If no terms were found, output a default message. */ |
|
| 824 | - else {
|
|
| 825 | - _e('No Categories', 'geodirectory');
|
|
| 826 | - } |
|
| 827 | - break; |
|
| 748 | + /** |
|
| 749 | + * Adds content to our custom post listing page columns. |
|
| 750 | + * |
|
| 751 | + * @since 1.0.0 |
|
| 752 | + * @package GeoDirectory |
|
| 753 | + * @global object $wpdb WordPress Database object. |
|
| 754 | + * @global object $post WordPress Post object. |
|
| 755 | + * @param string $column The column name. |
|
| 756 | + * @param int $post_id The post ID. |
|
| 757 | + */ |
|
| 758 | + function geodir_manage_post_columns($column, $post_id) |
|
| 759 | + {
|
|
| 760 | + global $post, $wpdb; |
|
| 761 | + |
|
| 762 | + switch ($column): |
|
| 763 | + /* If displaying the 'city' column. */ |
|
| 764 | + case 'location' : |
|
| 765 | + $location_id = geodir_get_post_meta($post->ID, 'post_location_id', true); |
|
| 766 | + $location = geodir_get_location($location_id); |
|
| 767 | + /* If no city is found, output a default message. */ |
|
| 768 | + if (empty($location)) {
|
|
| 769 | + _e('Unknown', 'geodirectory');
|
|
| 770 | + } else {
|
|
| 771 | + /* If there is a city id, append 'city name' to the text string. */ |
|
| 772 | + $add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : '';
|
|
| 773 | + echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id); |
|
| 774 | + } |
|
| 775 | + break; |
|
| 776 | + |
|
| 777 | + /* If displaying the 'expire' column. */ |
|
| 778 | + case 'expire' : |
|
| 779 | + $expire_date = geodir_get_post_meta($post->ID, 'expire_date', true); |
|
| 780 | + $d1 = $expire_date; // get expire_date |
|
| 781 | + $d2 = date('Y-m-d'); // get current date
|
|
| 782 | + $state = __('days left', 'geodirectory');
|
|
| 783 | + $date_diff_text = ''; |
|
| 784 | + $expire_class = 'expire_left'; |
|
| 785 | + if ($expire_date != 'Never') {
|
|
| 786 | + if (strtotime($d1) < strtotime($d2)) {
|
|
| 787 | + $state = __('days overdue', 'geodirectory');
|
|
| 788 | + $expire_class = 'expire_over'; |
|
| 789 | + } |
|
| 790 | + $date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days |
|
| 791 | + $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>';
|
|
| 792 | + } |
|
| 793 | + /* If no expire_date is found, output a default message. */ |
|
| 794 | + if (empty($expire_date)) |
|
| 795 | + echo __('Unknown', 'geodirectory');
|
|
| 796 | + /* If there is a expire_date, append 'days left' to the text string. */ |
|
| 797 | + else |
|
| 798 | + echo $expire_date . $date_diff_text; |
|
| 799 | + break; |
|
| 828 | 800 | |
| 829 | - endswitch; |
|
| 830 | - } |
|
| 801 | + /* If displaying the 'categorys' column. */ |
|
| 802 | + case 'categorys' : |
|
| 803 | + |
|
| 804 | + /* Get the categorys for the post. */ |
|
| 805 | + |
|
| 806 | + |
|
| 807 | + $terms = wp_get_object_terms($post_id, get_object_taxonomies($post)); |
|
| 808 | + |
|
| 809 | + /* If terms were found. */ |
|
| 810 | + if (!empty($terms)) {
|
|
| 811 | + $out = array(); |
|
| 812 | + /* Loop through each term, linking to the 'edit posts' page for the specific term. */ |
|
| 813 | + foreach ($terms as $term) {
|
|
| 814 | + if (!strstr($term->taxonomy, 'tag')) {
|
|
| 815 | + $out[] = sprintf('<a href="%s">%s</a>',
|
|
| 816 | + esc_url(add_query_arg(array('post_type' => $post->post_type, $term->taxonomy => $term->slug), 'edit.php')),
|
|
| 817 | + esc_html(sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'display'))
|
|
| 818 | + ); |
|
| 819 | + } |
|
| 820 | + } |
|
| 821 | + /* Join the terms, separating them with a comma. */ |
|
| 822 | + echo(join(', ', $out));
|
|
| 823 | + } /* If no terms were found, output a default message. */ |
|
| 824 | + else {
|
|
| 825 | + _e('No Categories', 'geodirectory');
|
|
| 826 | + } |
|
| 827 | + break; |
|
| 828 | + |
|
| 829 | + endswitch; |
|
| 830 | + } |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | |
| 834 | 834 | if (!function_exists('geodir_post_sortable_columns')) {
|
| 835 | - /** |
|
| 836 | - * Makes admin post listing page columns sortable. |
|
| 837 | - * |
|
| 838 | - * @since 1.0.0 |
|
| 839 | - * @package GeoDirectory |
|
| 840 | - * @param array $columns The column array. |
|
| 841 | - * @return array Altered column array. |
|
| 842 | - */ |
|
| 843 | - function geodir_post_sortable_columns($columns) |
|
| 844 | - {
|
|
| 845 | - |
|
| 846 | - $columns['expire'] = 'expire'; |
|
| 847 | - |
|
| 848 | - return $columns; |
|
| 849 | - } |
|
| 835 | + /** |
|
| 836 | + * Makes admin post listing page columns sortable. |
|
| 837 | + * |
|
| 838 | + * @since 1.0.0 |
|
| 839 | + * @package GeoDirectory |
|
| 840 | + * @param array $columns The column array. |
|
| 841 | + * @return array Altered column array. |
|
| 842 | + */ |
|
| 843 | + function geodir_post_sortable_columns($columns) |
|
| 844 | + {
|
|
| 845 | + |
|
| 846 | + $columns['expire'] = 'expire'; |
|
| 847 | + |
|
| 848 | + return $columns; |
|
| 849 | + } |
|
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | /** |
@@ -860,32 +860,32 @@ discard block |
||
| 860 | 860 | * @param int $post_id The post ID. |
| 861 | 861 | */ |
| 862 | 862 | function geodir_post_information_save($post_id, $post) {
|
| 863 | - global $wpdb, $current_user; |
|
| 863 | + global $wpdb, $current_user; |
|
| 864 | 864 | |
| 865 | - if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) {
|
|
| 866 | - return; |
|
| 867 | - } |
|
| 865 | + if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) {
|
|
| 866 | + return; |
|
| 867 | + } |
|
| 868 | 868 | |
| 869 | - $geodir_posttypes = geodir_get_posttypes(); |
|
| 869 | + $geodir_posttypes = geodir_get_posttypes(); |
|
| 870 | 870 | |
| 871 | - if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
|
|
| 872 | - return; |
|
| 871 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
|
|
| 872 | + return; |
|
| 873 | 873 | |
| 874 | - if (!wp_is_post_revision($post_id) && isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)) {
|
|
| 875 | - if (isset($_REQUEST['_status'])) |
|
| 876 | - geodir_change_post_status($post_id, $_REQUEST['_status']); |
|
| 874 | + if (!wp_is_post_revision($post_id) && isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)) {
|
|
| 875 | + if (isset($_REQUEST['_status'])) |
|
| 876 | + geodir_change_post_status($post_id, $_REQUEST['_status']); |
|
| 877 | 877 | |
| 878 | - if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'trash' || $_REQUEST['action'] == 'untrash')) |
|
| 879 | - return; |
|
| 878 | + if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'trash' || $_REQUEST['action'] == 'untrash')) |
|
| 879 | + return; |
|
| 880 | 880 | |
| 881 | - if (!isset($_POST['geodir_post_info_noncename']) || !wp_verify_nonce($_POST['geodir_post_info_noncename'], plugin_basename(__FILE__))) |
|
| 882 | - return; |
|
| 881 | + if (!isset($_POST['geodir_post_info_noncename']) || !wp_verify_nonce($_POST['geodir_post_info_noncename'], plugin_basename(__FILE__))) |
|
| 882 | + return; |
|
| 883 | 883 | |
| 884 | - if (!isset($_POST['geodir_post_attachments_noncename']) || !wp_verify_nonce($_POST['geodir_post_attachments_noncename'], plugin_basename(__FILE__))) |
|
| 885 | - return; |
|
| 884 | + if (!isset($_POST['geodir_post_attachments_noncename']) || !wp_verify_nonce($_POST['geodir_post_attachments_noncename'], plugin_basename(__FILE__))) |
|
| 885 | + return; |
|
| 886 | 886 | |
| 887 | - geodir_save_listing($_REQUEST); |
|
| 888 | - } |
|
| 887 | + geodir_save_listing($_REQUEST); |
|
| 888 | + } |
|
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | /** |
@@ -901,102 +901,102 @@ discard block |
||
| 901 | 901 | */ |
| 902 | 902 | function geodir_admin_fields($options) |
| 903 | 903 | {
|
| 904 | - global $geodirectory; |
|
| 905 | - |
|
| 906 | - $first_title = true; |
|
| 907 | - $tab_id = ''; |
|
| 908 | - $i = 0; |
|
| 909 | - foreach ($options as $value) : |
|
| 910 | - if (!isset($value['name'])) $value['name'] = ''; |
|
| 911 | - if (!isset($value['class'])) $value['class'] = ''; |
|
| 912 | - if (!isset($value['css'])) $value['css'] = ''; |
|
| 913 | - if (!isset($value['std'])) $value['std'] = ''; |
|
| 914 | - $desc = ''; |
|
| 915 | - switch ($value['type']) : |
|
| 916 | - case 'dummy_installer': |
|
| 917 | - $post_type = isset($value['post_type']) ? $value['post_type'] : 'gd_place'; |
|
| 918 | - geodir_autoinstall_admin_header($post_type); |
|
| 919 | - break; |
|
| 920 | - case 'title': |
|
| 921 | - |
|
| 922 | - if ($i == 0) {
|
|
| 923 | - echo '<dl id="geodir_oiption_tabs" class="gd-tab-head"></dl>'; |
|
| 924 | - echo '<div class="inner_content_tab_main">'; |
|
| 925 | - } |
|
| 904 | + global $geodirectory; |
|
| 905 | + |
|
| 906 | + $first_title = true; |
|
| 907 | + $tab_id = ''; |
|
| 908 | + $i = 0; |
|
| 909 | + foreach ($options as $value) : |
|
| 910 | + if (!isset($value['name'])) $value['name'] = ''; |
|
| 911 | + if (!isset($value['class'])) $value['class'] = ''; |
|
| 912 | + if (!isset($value['css'])) $value['css'] = ''; |
|
| 913 | + if (!isset($value['std'])) $value['std'] = ''; |
|
| 914 | + $desc = ''; |
|
| 915 | + switch ($value['type']) : |
|
| 916 | + case 'dummy_installer': |
|
| 917 | + $post_type = isset($value['post_type']) ? $value['post_type'] : 'gd_place'; |
|
| 918 | + geodir_autoinstall_admin_header($post_type); |
|
| 919 | + break; |
|
| 920 | + case 'title': |
|
| 921 | + |
|
| 922 | + if ($i == 0) {
|
|
| 923 | + echo '<dl id="geodir_oiption_tabs" class="gd-tab-head"></dl>'; |
|
| 924 | + echo '<div class="inner_content_tab_main">'; |
|
| 925 | + } |
|
| 926 | 926 | |
| 927 | - $i++; |
|
| 927 | + $i++; |
|
| 928 | 928 | |
| 929 | - if (isset($value['id']) && $value['id']) |
|
| 930 | - $tab_id = $value['id']; |
|
| 929 | + if (isset($value['id']) && $value['id']) |
|
| 930 | + $tab_id = $value['id']; |
|
| 931 | 931 | |
| 932 | - if (isset($value['desc']) && $value['desc']) |
|
| 933 | - $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
| 932 | + if (isset($value['desc']) && $value['desc']) |
|
| 933 | + $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
| 934 | 934 | |
| 935 | - if (isset($value['name']) && $value['name']) {
|
|
| 936 | - if ($first_title === true) {
|
|
| 937 | - $first_title = false; |
|
| 938 | - } else {
|
|
| 939 | - echo '</div>'; |
|
| 940 | - } |
|
| 941 | - echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>'; |
|
| 935 | + if (isset($value['name']) && $value['name']) {
|
|
| 936 | + if ($first_title === true) {
|
|
| 937 | + $first_title = false; |
|
| 938 | + } else {
|
|
| 939 | + echo '</div>'; |
|
| 940 | + } |
|
| 941 | + echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>'; |
|
| 942 | 942 | |
| 943 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 944 | - } |
|
| 943 | + echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 944 | + } |
|
| 945 | 945 | |
| 946 | - /** |
|
| 947 | - * Called after a GeoDirectory settings title is output in the GD settings page. |
|
| 948 | - * |
|
| 949 | - * The action is called dynamically geodir_settings_$value['id']. |
|
| 950 | - * |
|
| 951 | - * @since 1.0.0 |
|
| 952 | - */ |
|
| 953 | - do_action('geodir_settings_' . sanitize_title($value['id']));
|
|
| 954 | - break; |
|
| 955 | - |
|
| 956 | - case 'no_tabs': |
|
| 957 | - |
|
| 958 | - echo '<div class="inner_content_tab_main">'; |
|
| 959 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 960 | - |
|
| 961 | - break; |
|
| 962 | - |
|
| 963 | - case 'sectionstart': |
|
| 964 | - if (isset($value['desc']) && $value['desc']) |
|
| 965 | - $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>'; |
|
| 966 | - if (isset($value['name']) && $value['name']) |
|
| 967 | - echo '<h3>' . $value['name'] . $desc . '</h3>'; |
|
| 968 | - /** |
|
| 969 | - * Called after a GeoDirectory settings sectionstart is output in the GD settings page. |
|
| 970 | - * |
|
| 971 | - * The action is called dynamically geodir_settings_$value['id']_start. |
|
| 972 | - * |
|
| 973 | - * @since 1.0.0 |
|
| 974 | - */ |
|
| 975 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start');
|
|
| 976 | - echo '<table class="form-table">' . "\n\n"; |
|
| 977 | - |
|
| 978 | - break; |
|
| 979 | - case 'sectionend': |
|
| 980 | - /** |
|
| 981 | - * Called before a GeoDirectory settings sectionend is output in the GD settings page. |
|
| 982 | - * |
|
| 983 | - * The action is called dynamically geodir_settings_$value['id']_end. |
|
| 984 | - * |
|
| 985 | - * @since 1.0.0 |
|
| 986 | - */ |
|
| 987 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
|
|
| 988 | - echo '</table>'; |
|
| 989 | - /** |
|
| 990 | - * Called after a GeoDirectory settings sectionend is output in the GD settings page. |
|
| 991 | - * |
|
| 992 | - * The action is called dynamically geodir_settings_$value['id']_end. |
|
| 993 | - * |
|
| 994 | - * @since 1.0.0 |
|
| 995 | - */ |
|
| 996 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
|
|
| 997 | - break; |
|
| 998 | - case 'text': |
|
| 999 | - ?> |
|
| 946 | + /** |
|
| 947 | + * Called after a GeoDirectory settings title is output in the GD settings page. |
|
| 948 | + * |
|
| 949 | + * The action is called dynamically geodir_settings_$value['id']. |
|
| 950 | + * |
|
| 951 | + * @since 1.0.0 |
|
| 952 | + */ |
|
| 953 | + do_action('geodir_settings_' . sanitize_title($value['id']));
|
|
| 954 | + break; |
|
| 955 | + |
|
| 956 | + case 'no_tabs': |
|
| 957 | + |
|
| 958 | + echo '<div class="inner_content_tab_main">'; |
|
| 959 | + echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 960 | + |
|
| 961 | + break; |
|
| 962 | + |
|
| 963 | + case 'sectionstart': |
|
| 964 | + if (isset($value['desc']) && $value['desc']) |
|
| 965 | + $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>'; |
|
| 966 | + if (isset($value['name']) && $value['name']) |
|
| 967 | + echo '<h3>' . $value['name'] . $desc . '</h3>'; |
|
| 968 | + /** |
|
| 969 | + * Called after a GeoDirectory settings sectionstart is output in the GD settings page. |
|
| 970 | + * |
|
| 971 | + * The action is called dynamically geodir_settings_$value['id']_start. |
|
| 972 | + * |
|
| 973 | + * @since 1.0.0 |
|
| 974 | + */ |
|
| 975 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start');
|
|
| 976 | + echo '<table class="form-table">' . "\n\n"; |
|
| 977 | + |
|
| 978 | + break; |
|
| 979 | + case 'sectionend': |
|
| 980 | + /** |
|
| 981 | + * Called before a GeoDirectory settings sectionend is output in the GD settings page. |
|
| 982 | + * |
|
| 983 | + * The action is called dynamically geodir_settings_$value['id']_end. |
|
| 984 | + * |
|
| 985 | + * @since 1.0.0 |
|
| 986 | + */ |
|
| 987 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
|
|
| 988 | + echo '</table>'; |
|
| 989 | + /** |
|
| 990 | + * Called after a GeoDirectory settings sectionend is output in the GD settings page. |
|
| 991 | + * |
|
| 992 | + * The action is called dynamically geodir_settings_$value['id']_end. |
|
| 993 | + * |
|
| 994 | + * @since 1.0.0 |
|
| 995 | + */ |
|
| 996 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
|
|
| 997 | + break; |
|
| 998 | + case 'text': |
|
| 999 | + ?> |
|
| 1000 | 1000 | <tr valign="top"> |
| 1001 | 1001 | <th scope="row" class="titledesc"><?php echo $value['name']; ?></th> |
| 1002 | 1002 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
@@ -1005,15 +1005,15 @@ discard block |
||
| 1005 | 1005 | <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
| 1006 | 1006 | style=" <?php echo esc_attr($value['css']); ?>" |
| 1007 | 1007 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
|
| 1008 | - echo esc_attr(stripslashes(get_option($value['id']))); |
|
| 1009 | - } else {
|
|
| 1010 | - echo esc_attr($value['std']); |
|
| 1011 | - } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td> |
|
| 1008 | + echo esc_attr(stripslashes(get_option($value['id']))); |
|
| 1009 | + } else {
|
|
| 1010 | + echo esc_attr($value['std']); |
|
| 1011 | + } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td> |
|
| 1012 | 1012 | </tr><?php |
| 1013 | - break; |
|
| 1013 | + break; |
|
| 1014 | 1014 | |
| 1015 | - case 'password': |
|
| 1016 | - ?> |
|
| 1015 | + case 'password': |
|
| 1016 | + ?> |
|
| 1017 | 1017 | <tr valign="top"> |
| 1018 | 1018 | <th scope="row" class="titledesc"><?php echo $value['name']; ?></th> |
| 1019 | 1019 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
@@ -1022,42 +1022,42 @@ discard block |
||
| 1022 | 1022 | <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
| 1023 | 1023 | style="<?php echo esc_attr($value['css']); ?>" |
| 1024 | 1024 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
|
| 1025 | - echo esc_attr(stripslashes(get_option($value['id']))); |
|
| 1026 | - } else {
|
|
| 1027 | - echo esc_attr($value['std']); |
|
| 1028 | - } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td> |
|
| 1025 | + echo esc_attr(stripslashes(get_option($value['id']))); |
|
| 1026 | + } else {
|
|
| 1027 | + echo esc_attr($value['std']); |
|
| 1028 | + } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td> |
|
| 1029 | 1029 | </tr><?php |
| 1030 | - break; |
|
| 1030 | + break; |
|
| 1031 | 1031 | |
| 1032 | - case 'html_content': |
|
| 1033 | - ?> |
|
| 1032 | + case 'html_content': |
|
| 1033 | + ?> |
|
| 1034 | 1034 | <tr valign="top"> |
| 1035 | 1035 | <th scope="row" class="titledesc"><?php echo $value['name']; ?></th> |
| 1036 | 1036 | <td class="forminp"><span class="description"><?php echo $value['desc']; ?></span></td> |
| 1037 | 1037 | </tr><?php |
| 1038 | - break; |
|
| 1038 | + break; |
|
| 1039 | 1039 | |
| 1040 | - case 'color' : |
|
| 1041 | - ?> |
|
| 1040 | + case 'color' : |
|
| 1041 | + ?> |
|
| 1042 | 1042 | <tr valign="top"> |
| 1043 | 1043 | <th scope="row" class="titledesc"><?php echo $value['name']; ?></th> |
| 1044 | 1044 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
| 1045 | 1045 | id="<?php echo esc_attr($value['id']); ?>" type="text" |
| 1046 | 1046 | style="<?php echo esc_attr($value['css']); ?>" |
| 1047 | 1047 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
|
| 1048 | - echo esc_attr(stripslashes(get_option($value['id']))); |
|
| 1049 | - } else {
|
|
| 1050 | - echo esc_attr($value['std']); |
|
| 1051 | - } ?>" class="colorpick"/> <span |
|
| 1048 | + echo esc_attr(stripslashes(get_option($value['id']))); |
|
| 1049 | + } else {
|
|
| 1050 | + echo esc_attr($value['std']); |
|
| 1051 | + } ?>" class="colorpick"/> <span |
|
| 1052 | 1052 | class="description"><?php echo $value['desc']; ?></span> |
| 1053 | 1053 | |
| 1054 | 1054 | <div id="colorPickerDiv_<?php echo esc_attr($value['id']); ?>" class="colorpickdiv" |
| 1055 | 1055 | style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div> |
| 1056 | 1056 | </td> |
| 1057 | 1057 | </tr><?php |
| 1058 | - break; |
|
| 1059 | - case 'image_width' : |
|
| 1060 | - ?> |
|
| 1058 | + break; |
|
| 1059 | + case 'image_width' : |
|
| 1060 | + ?> |
|
| 1061 | 1061 | <tr valign="top"> |
| 1062 | 1062 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1063 | 1063 | <td class="forminp"> |
@@ -1079,11 +1079,11 @@ discard block |
||
| 1079 | 1079 | |
| 1080 | 1080 | <span class="description"><?php echo $value['desc'] ?></span></td> |
| 1081 | 1081 | </tr><?php |
| 1082 | - break; |
|
| 1083 | - case 'select': |
|
| 1084 | - $option_value = get_option($value['id']); |
|
| 1085 | - $option_value = !empty($option_value) ? stripslashes_deep($option_value) : $option_value; |
|
| 1086 | - ?> |
|
| 1082 | + break; |
|
| 1083 | + case 'select': |
|
| 1084 | + $option_value = get_option($value['id']); |
|
| 1085 | + $option_value = !empty($option_value) ? stripslashes_deep($option_value) : $option_value; |
|
| 1086 | + ?> |
|
| 1087 | 1087 | <tr valign="top"> |
| 1088 | 1088 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1089 | 1089 | <td class="forminp"><select name="<?php echo esc_attr($value['id']); ?>" |
@@ -1092,33 +1092,33 @@ discard block |
||
| 1092 | 1092 | class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
| 1093 | 1093 | option-ajaxchosen="false"> |
| 1094 | 1094 | <?php |
| 1095 | - foreach ($value['options'] as $key => $val) {
|
|
| 1096 | - $geodir_select_value = ''; |
|
| 1097 | - if ($option_value != '') {
|
|
| 1098 | - if ($option_value != '' && $option_value == $key) |
|
| 1099 | - $geodir_select_value = ' selected="selected" '; |
|
| 1100 | - } else {
|
|
| 1101 | - if ($value['std'] == $key) |
|
| 1102 | - $geodir_select_value = ' selected="selected" '; |
|
| 1103 | - } |
|
| 1104 | - ?> |
|
| 1095 | + foreach ($value['options'] as $key => $val) {
|
|
| 1096 | + $geodir_select_value = ''; |
|
| 1097 | + if ($option_value != '') {
|
|
| 1098 | + if ($option_value != '' && $option_value == $key) |
|
| 1099 | + $geodir_select_value = ' selected="selected" '; |
|
| 1100 | + } else {
|
|
| 1101 | + if ($value['std'] == $key) |
|
| 1102 | + $geodir_select_value = ' selected="selected" '; |
|
| 1103 | + } |
|
| 1104 | + ?> |
|
| 1105 | 1105 | <option |
| 1106 | 1106 | value="<?php echo esc_attr($key); ?>" <?php echo $geodir_select_value; ?> ><?php echo ucfirst($val) ?></option> |
| 1107 | 1107 | <?php |
| 1108 | - } |
|
| 1109 | - ?> |
|
| 1108 | + } |
|
| 1109 | + ?> |
|
| 1110 | 1110 | </select> <span class="description"><?php echo $value['desc'] ?></span> |
| 1111 | 1111 | </td> |
| 1112 | 1112 | </tr><?php |
| 1113 | - break; |
|
| 1113 | + break; |
|
| 1114 | 1114 | |
| 1115 | - case 'multiselect': |
|
| 1116 | - $option_values = get_option($value['id']); |
|
| 1117 | - if ($option_values === '' && !empty($value['std']) && is_array($value['std'])) {
|
|
| 1118 | - $option_values = $value['std']; |
|
| 1119 | - } |
|
| 1120 | - $option_values = !empty($option_values) ? stripslashes_deep($option_values) : $option_values; |
|
| 1121 | - ?> |
|
| 1115 | + case 'multiselect': |
|
| 1116 | + $option_values = get_option($value['id']); |
|
| 1117 | + if ($option_values === '' && !empty($value['std']) && is_array($value['std'])) {
|
|
| 1118 | + $option_values = $value['std']; |
|
| 1119 | + } |
|
| 1120 | + $option_values = !empty($option_values) ? stripslashes_deep($option_values) : $option_values; |
|
| 1121 | + ?> |
|
| 1122 | 1122 | <tr valign="top"> |
| 1123 | 1123 | <th scope="row" class="titledesc"><?php echo $value['name']; ?></th> |
| 1124 | 1124 | <td class="forminp"><select multiple="multiple" name="<?php echo esc_attr($value['id']); ?>[]" |
@@ -1128,25 +1128,25 @@ discard block |
||
| 1128 | 1128 | data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>" |
| 1129 | 1129 | option-ajaxchosen="false"> |
| 1130 | 1130 | <?php |
| 1131 | - foreach ($value['options'] as $key => $val) {
|
|
| 1132 | - if (strpos($key, 'optgroup_start-') === 0) {
|
|
| 1133 | - ?><optgroup label="<?php echo ucfirst($val); ?>"><?php |
|
| 1134 | - } else if (strpos($key, 'optgroup_end-') === 0) {
|
|
| 1135 | - ?></optgroup><?php |
|
| 1136 | - } else {
|
|
| 1137 | - ?> |
|
| 1131 | + foreach ($value['options'] as $key => $val) {
|
|
| 1132 | + if (strpos($key, 'optgroup_start-') === 0) {
|
|
| 1133 | + ?><optgroup label="<?php echo ucfirst($val); ?>"><?php |
|
| 1134 | + } else if (strpos($key, 'optgroup_end-') === 0) {
|
|
| 1135 | + ?></optgroup><?php |
|
| 1136 | + } else {
|
|
| 1137 | + ?> |
|
| 1138 | 1138 | <option |
| 1139 | 1139 | value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values)));?>><?php echo ucfirst($val) ?></option> |
| 1140 | 1140 | <?php |
| 1141 | - } |
|
| 1142 | - } |
|
| 1143 | - ?> |
|
| 1141 | + } |
|
| 1142 | + } |
|
| 1143 | + ?> |
|
| 1144 | 1144 | </select> <span class="description"><?php echo $value['desc'] ?></span> |
| 1145 | 1145 | </td> |
| 1146 | 1146 | </tr><?php |
| 1147 | - break; |
|
| 1148 | - case 'file': |
|
| 1149 | - ?> |
|
| 1147 | + break; |
|
| 1148 | + case 'file': |
|
| 1149 | + ?> |
|
| 1150 | 1150 | <tr valign="top"> |
| 1151 | 1151 | <th scope="row" class="titledesc"><?php echo $value['name']; ?></th> |
| 1152 | 1152 | <td class="forminp"> |
@@ -1166,87 +1166,87 @@ discard block |
||
| 1166 | 1166 | <?php } ?> |
| 1167 | 1167 | </td> |
| 1168 | 1168 | </tr><?php |
| 1169 | - break; |
|
| 1170 | - case 'map_default_settings' : |
|
| 1171 | - ?> |
|
| 1169 | + break; |
|
| 1170 | + case 'map_default_settings' : |
|
| 1171 | + ?> |
|
| 1172 | 1172 | |
| 1173 | 1173 | <tr valign="top"> |
| 1174 | 1174 | <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th>
|
| 1175 | 1175 | <td width="60%"> |
| 1176 | 1176 | <select name="geodir_default_map_language" style="width:60%"> |
| 1177 | 1177 | <?php |
| 1178 | - $arr_map_langages = array( |
|
| 1179 | - 'ar' => __('ARABIC', 'geodirectory'),
|
|
| 1180 | - 'eu' => __('BASQUE', 'geodirectory'),
|
|
| 1181 | - 'bg' => __('BULGARIAN', 'geodirectory'),
|
|
| 1182 | - 'bn' => __('BENGALI', 'geodirectory'),
|
|
| 1183 | - 'ca' => __('CATALAN', 'geodirectory'),
|
|
| 1184 | - 'cs' => __('CZECH', 'geodirectory'),
|
|
| 1185 | - 'da' => __('DANISH', 'geodirectory'),
|
|
| 1186 | - 'de' => __('GERMAN', 'geodirectory'),
|
|
| 1187 | - 'el' => __('GREEK', 'geodirectory'),
|
|
| 1188 | - 'en' => __('ENGLISH', 'geodirectory'),
|
|
| 1189 | - 'en-AU' => __('ENGLISH (AUSTRALIAN)', 'geodirectory'),
|
|
| 1190 | - 'en-GB' => __('ENGLISH (GREAT BRITAIN)', 'geodirectory'),
|
|
| 1191 | - 'es' => __('SPANISH', 'geodirectory'),
|
|
| 1192 | - 'eu' => __('BASQUE', 'geodirectory'),
|
|
| 1193 | - 'fa' => __('FARSI', 'geodirectory'),
|
|
| 1194 | - 'fi' => __('FINNISH', 'geodirectory'),
|
|
| 1195 | - 'fil' => __('FILIPINO', 'geodirectory'),
|
|
| 1196 | - 'fr' => __('FRENCH', 'geodirectory'),
|
|
| 1197 | - 'gl' => __('GALICIAN', 'geodirectory'),
|
|
| 1198 | - 'gu' => __('GUJARATI', 'geodirectory'),
|
|
| 1199 | - 'hi' => __('HINDI', 'geodirectory'),
|
|
| 1200 | - 'hr' => __('CROATIAN', 'geodirectory'),
|
|
| 1201 | - 'hu' => __('HUNGARIAN', 'geodirectory'),
|
|
| 1202 | - 'id' => __('INDONESIAN', 'geodirectory'),
|
|
| 1203 | - 'it' => __('ITALIAN', 'geodirectory'),
|
|
| 1204 | - 'iw' => __('HEBREW', 'geodirectory'),
|
|
| 1205 | - 'ja' => __('JAPANESE', 'geodirectory'),
|
|
| 1206 | - 'kn' => __('KANNADA', 'geodirectory'),
|
|
| 1207 | - 'ko' => __('KOREAN', 'geodirectory'),
|
|
| 1208 | - 'lt' => __('LITHUANIAN', 'geodirectory'),
|
|
| 1209 | - 'lv' => __('LATVIAN', 'geodirectory'),
|
|
| 1210 | - 'ml' => __('MALAYALAM', 'geodirectory'),
|
|
| 1211 | - 'mr' => __('MARATHI', 'geodirectory'),
|
|
| 1212 | - 'nl' => __('DUTCH', 'geodirectory'),
|
|
| 1213 | - 'no' => __('NORWEGIAN', 'geodirectory'),
|
|
| 1214 | - 'pl' => __('POLISH', 'geodirectory'),
|
|
| 1215 | - 'pt' => __('PORTUGUESE', 'geodirectory'),
|
|
| 1216 | - 'pt-BR' => __('PORTUGUESE (BRAZIL)', 'geodirectory'),
|
|
| 1217 | - 'pt-PT' => __('PORTUGUESE (PORTUGAL)', 'geodirectory'),
|
|
| 1218 | - 'ro' => __('ROMANIAN', 'geodirectory'),
|
|
| 1219 | - 'ru' => __('RUSSIAN', 'geodirectory'),
|
|
| 1220 | - 'ru' => __('RUSSIAN', 'geodirectory'),
|
|
| 1221 | - 'sk' => __('SLOVAK', 'geodirectory'),
|
|
| 1222 | - 'sl' => __('SLOVENIAN', 'geodirectory'),
|
|
| 1223 | - 'sr' => __('SERBIAN', 'geodirectory'),
|
|
| 1224 | - 'sv' => __(' SWEDISH', 'geodirectory'),
|
|
| 1225 | - 'tl' => __('TAGALOG', 'geodirectory'),
|
|
| 1226 | - 'ta' => __('TAMIL', 'geodirectory'),
|
|
| 1227 | - 'te' => __('TELUGU', 'geodirectory'),
|
|
| 1228 | - 'th' => __('THAI', 'geodirectory'),
|
|
| 1229 | - 'tr' => __('TURKISH', 'geodirectory'),
|
|
| 1230 | - 'uk' => __('UKRAINIAN', 'geodirectory'),
|
|
| 1231 | - 'vi' => __('VIETNAMESE', 'geodirectory'),
|
|
| 1232 | - 'zh-CN' => __('CHINESE (SIMPLIFIED)', 'geodirectory'),
|
|
| 1233 | - 'zh-TW' => __('CHINESE (TRADITIONAL)', 'geodirectory'),
|
|
| 1234 | - ); |
|
| 1235 | - $geodir_default_map_language = get_option('geodir_default_map_language');
|
|
| 1236 | - if (empty($geodir_default_map_language)) |
|
| 1237 | - $geodir_default_map_language = 'en'; |
|
| 1238 | - foreach ($arr_map_langages as $language_key => $language_txt) {
|
|
| 1239 | - if (!empty($geodir_default_map_language) && $language_key == $geodir_default_map_language) |
|
| 1240 | - $geodir_default_language_selected = "selected='selected'"; |
|
| 1241 | - else |
|
| 1242 | - $geodir_default_language_selected = ''; |
|
| 1243 | - |
|
| 1244 | - ?> |
|
| 1178 | + $arr_map_langages = array( |
|
| 1179 | + 'ar' => __('ARABIC', 'geodirectory'),
|
|
| 1180 | + 'eu' => __('BASQUE', 'geodirectory'),
|
|
| 1181 | + 'bg' => __('BULGARIAN', 'geodirectory'),
|
|
| 1182 | + 'bn' => __('BENGALI', 'geodirectory'),
|
|
| 1183 | + 'ca' => __('CATALAN', 'geodirectory'),
|
|
| 1184 | + 'cs' => __('CZECH', 'geodirectory'),
|
|
| 1185 | + 'da' => __('DANISH', 'geodirectory'),
|
|
| 1186 | + 'de' => __('GERMAN', 'geodirectory'),
|
|
| 1187 | + 'el' => __('GREEK', 'geodirectory'),
|
|
| 1188 | + 'en' => __('ENGLISH', 'geodirectory'),
|
|
| 1189 | + 'en-AU' => __('ENGLISH (AUSTRALIAN)', 'geodirectory'),
|
|
| 1190 | + 'en-GB' => __('ENGLISH (GREAT BRITAIN)', 'geodirectory'),
|
|
| 1191 | + 'es' => __('SPANISH', 'geodirectory'),
|
|
| 1192 | + 'eu' => __('BASQUE', 'geodirectory'),
|
|
| 1193 | + 'fa' => __('FARSI', 'geodirectory'),
|
|
| 1194 | + 'fi' => __('FINNISH', 'geodirectory'),
|
|
| 1195 | + 'fil' => __('FILIPINO', 'geodirectory'),
|
|
| 1196 | + 'fr' => __('FRENCH', 'geodirectory'),
|
|
| 1197 | + 'gl' => __('GALICIAN', 'geodirectory'),
|
|
| 1198 | + 'gu' => __('GUJARATI', 'geodirectory'),
|
|
| 1199 | + 'hi' => __('HINDI', 'geodirectory'),
|
|
| 1200 | + 'hr' => __('CROATIAN', 'geodirectory'),
|
|
| 1201 | + 'hu' => __('HUNGARIAN', 'geodirectory'),
|
|
| 1202 | + 'id' => __('INDONESIAN', 'geodirectory'),
|
|
| 1203 | + 'it' => __('ITALIAN', 'geodirectory'),
|
|
| 1204 | + 'iw' => __('HEBREW', 'geodirectory'),
|
|
| 1205 | + 'ja' => __('JAPANESE', 'geodirectory'),
|
|
| 1206 | + 'kn' => __('KANNADA', 'geodirectory'),
|
|
| 1207 | + 'ko' => __('KOREAN', 'geodirectory'),
|
|
| 1208 | + 'lt' => __('LITHUANIAN', 'geodirectory'),
|
|
| 1209 | + 'lv' => __('LATVIAN', 'geodirectory'),
|
|
| 1210 | + 'ml' => __('MALAYALAM', 'geodirectory'),
|
|
| 1211 | + 'mr' => __('MARATHI', 'geodirectory'),
|
|
| 1212 | + 'nl' => __('DUTCH', 'geodirectory'),
|
|
| 1213 | + 'no' => __('NORWEGIAN', 'geodirectory'),
|
|
| 1214 | + 'pl' => __('POLISH', 'geodirectory'),
|
|
| 1215 | + 'pt' => __('PORTUGUESE', 'geodirectory'),
|
|
| 1216 | + 'pt-BR' => __('PORTUGUESE (BRAZIL)', 'geodirectory'),
|
|
| 1217 | + 'pt-PT' => __('PORTUGUESE (PORTUGAL)', 'geodirectory'),
|
|
| 1218 | + 'ro' => __('ROMANIAN', 'geodirectory'),
|
|
| 1219 | + 'ru' => __('RUSSIAN', 'geodirectory'),
|
|
| 1220 | + 'ru' => __('RUSSIAN', 'geodirectory'),
|
|
| 1221 | + 'sk' => __('SLOVAK', 'geodirectory'),
|
|
| 1222 | + 'sl' => __('SLOVENIAN', 'geodirectory'),
|
|
| 1223 | + 'sr' => __('SERBIAN', 'geodirectory'),
|
|
| 1224 | + 'sv' => __(' SWEDISH', 'geodirectory'),
|
|
| 1225 | + 'tl' => __('TAGALOG', 'geodirectory'),
|
|
| 1226 | + 'ta' => __('TAMIL', 'geodirectory'),
|
|
| 1227 | + 'te' => __('TELUGU', 'geodirectory'),
|
|
| 1228 | + 'th' => __('THAI', 'geodirectory'),
|
|
| 1229 | + 'tr' => __('TURKISH', 'geodirectory'),
|
|
| 1230 | + 'uk' => __('UKRAINIAN', 'geodirectory'),
|
|
| 1231 | + 'vi' => __('VIETNAMESE', 'geodirectory'),
|
|
| 1232 | + 'zh-CN' => __('CHINESE (SIMPLIFIED)', 'geodirectory'),
|
|
| 1233 | + 'zh-TW' => __('CHINESE (TRADITIONAL)', 'geodirectory'),
|
|
| 1234 | + ); |
|
| 1235 | + $geodir_default_map_language = get_option('geodir_default_map_language');
|
|
| 1236 | + if (empty($geodir_default_map_language)) |
|
| 1237 | + $geodir_default_map_language = 'en'; |
|
| 1238 | + foreach ($arr_map_langages as $language_key => $language_txt) {
|
|
| 1239 | + if (!empty($geodir_default_map_language) && $language_key == $geodir_default_map_language) |
|
| 1240 | + $geodir_default_language_selected = "selected='selected'"; |
|
| 1241 | + else |
|
| 1242 | + $geodir_default_language_selected = ''; |
|
| 1243 | + |
|
| 1244 | + ?> |
|
| 1245 | 1245 | <option |
| 1246 | 1246 | value="<?php echo $language_key?>" <?php echo $geodir_default_language_selected; ?>><?php echo $language_txt; ?></option> |
| 1247 | 1247 | |
| 1248 | 1248 | <?php } |
| 1249 | - ?> |
|
| 1249 | + ?> |
|
| 1250 | 1250 | </select> |
| 1251 | 1251 | </td> |
| 1252 | 1252 | </tr> |
@@ -1257,46 +1257,46 @@ discard block |
||
| 1257 | 1257 | <td width="60%"> |
| 1258 | 1258 | <select name="geodir_default_map_search_pt" style="width:60%"> |
| 1259 | 1259 | <?php |
| 1260 | - $post_types = geodir_get_posttypes('array');
|
|
| 1261 | - $geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
|
|
| 1262 | - if (empty($geodir_default_map_search_pt)) |
|
| 1263 | - $geodir_default_map_search_pt = 'gd_place'; |
|
| 1264 | - if (is_array($post_types)) {
|
|
| 1265 | - foreach ($post_types as $key => $post_types_obj) {
|
|
| 1266 | - if (!empty($geodir_default_map_search_pt) && $key == $geodir_default_map_search_pt) |
|
| 1267 | - $geodir_search_pt_selected = "selected='selected'"; |
|
| 1268 | - else |
|
| 1269 | - $geodir_search_pt_selected = ''; |
|
| 1270 | - |
|
| 1271 | - ?> |
|
| 1260 | + $post_types = geodir_get_posttypes('array');
|
|
| 1261 | + $geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
|
|
| 1262 | + if (empty($geodir_default_map_search_pt)) |
|
| 1263 | + $geodir_default_map_search_pt = 'gd_place'; |
|
| 1264 | + if (is_array($post_types)) {
|
|
| 1265 | + foreach ($post_types as $key => $post_types_obj) {
|
|
| 1266 | + if (!empty($geodir_default_map_search_pt) && $key == $geodir_default_map_search_pt) |
|
| 1267 | + $geodir_search_pt_selected = "selected='selected'"; |
|
| 1268 | + else |
|
| 1269 | + $geodir_search_pt_selected = ''; |
|
| 1270 | + |
|
| 1271 | + ?> |
|
| 1272 | 1272 | <option |
| 1273 | 1273 | value="<?php echo $key?>" <?php echo $geodir_search_pt_selected; ?>><?php echo $post_types_obj['labels']['singular_name']; ?></option> |
| 1274 | 1274 | |
| 1275 | 1275 | <?php } |
| 1276 | 1276 | |
| 1277 | - } |
|
| 1277 | + } |
|
| 1278 | 1278 | |
| 1279 | - ?> |
|
| 1279 | + ?> |
|
| 1280 | 1280 | </select> |
| 1281 | 1281 | </td> |
| 1282 | 1282 | </tr> |
| 1283 | 1283 | |
| 1284 | 1284 | <?php |
| 1285 | - break; |
|
| 1285 | + break; |
|
| 1286 | 1286 | |
| 1287 | - case 'map': |
|
| 1288 | - ?> |
|
| 1287 | + case 'map': |
|
| 1288 | + ?> |
|
| 1289 | 1289 | <tr valign="top"> |
| 1290 | 1290 | <td class="forminp"> |
| 1291 | 1291 | <?php |
| 1292 | - global $post_cat, $cat_display; |
|
| 1293 | - $post_types = geodir_get_posttypes('object');
|
|
| 1294 | - $cat_display = 'checkbox'; |
|
| 1295 | - $gd_post_types = get_option('geodir_exclude_post_type_on_map');
|
|
| 1296 | - $gd_cats = get_option('geodir_exclude_cat_on_map');
|
|
| 1297 | - $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
|
|
| 1298 | - $count = 1; |
|
| 1299 | - ?> |
|
| 1292 | + global $post_cat, $cat_display; |
|
| 1293 | + $post_types = geodir_get_posttypes('object');
|
|
| 1294 | + $cat_display = 'checkbox'; |
|
| 1295 | + $gd_post_types = get_option('geodir_exclude_post_type_on_map');
|
|
| 1296 | + $gd_cats = get_option('geodir_exclude_cat_on_map');
|
|
| 1297 | + $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
|
|
| 1298 | + $count = 1; |
|
| 1299 | + ?> |
|
| 1300 | 1300 | <table width="70%" class="widefat"> |
| 1301 | 1301 | <thead> |
| 1302 | 1302 | <tr> |
@@ -1305,18 +1305,18 @@ discard block |
||
| 1305 | 1305 | <th><b><?php echo DESIGN_POST_TYPE_CAT; ?></b></th> |
| 1306 | 1306 | </tr> |
| 1307 | 1307 | <?php |
| 1308 | - $gd_categs = $gd_cats; |
|
| 1309 | - foreach ($post_types as $key => $post_types_obj) : |
|
| 1310 | - $checked = is_array($gd_post_types) && in_array($key, $gd_post_types) ? 'checked="checked"' : ''; |
|
| 1311 | - $gd_taxonomy = geodir_get_taxonomies($key); |
|
| 1312 | - if ($gd_cats_upgrade) {
|
|
| 1313 | - $gd_cat_taxonomy = isset($gd_taxonomy[0]) ? $gd_taxonomy[0] : ''; |
|
| 1314 | - $gd_cats = isset($gd_categs[$gd_cat_taxonomy]) ? $gd_categs[$gd_cat_taxonomy] : array(); |
|
| 1315 | - $gd_cats = !empty($gd_cats) && is_array($gd_cats) ? array_unique($gd_cats) : array(); |
|
| 1316 | - } |
|
| 1317 | - $post_cat = implode(',', $gd_cats);
|
|
| 1318 | - $gd_taxonomy_list = geodir_custom_taxonomy_walker($gd_taxonomy); |
|
| 1319 | - ?> |
|
| 1308 | + $gd_categs = $gd_cats; |
|
| 1309 | + foreach ($post_types as $key => $post_types_obj) : |
|
| 1310 | + $checked = is_array($gd_post_types) && in_array($key, $gd_post_types) ? 'checked="checked"' : ''; |
|
| 1311 | + $gd_taxonomy = geodir_get_taxonomies($key); |
|
| 1312 | + if ($gd_cats_upgrade) {
|
|
| 1313 | + $gd_cat_taxonomy = isset($gd_taxonomy[0]) ? $gd_taxonomy[0] : ''; |
|
| 1314 | + $gd_cats = isset($gd_categs[$gd_cat_taxonomy]) ? $gd_categs[$gd_cat_taxonomy] : array(); |
|
| 1315 | + $gd_cats = !empty($gd_cats) && is_array($gd_cats) ? array_unique($gd_cats) : array(); |
|
| 1316 | + } |
|
| 1317 | + $post_cat = implode(',', $gd_cats);
|
|
| 1318 | + $gd_taxonomy_list = geodir_custom_taxonomy_walker($gd_taxonomy); |
|
| 1319 | + ?> |
|
| 1320 | 1320 | <tr> |
| 1321 | 1321 | <td valign="top" width="5%"><?php echo $count; ?></td> |
| 1322 | 1322 | <td valign="top" width="25%" id="td_post_types"><input type="checkbox" |
@@ -1337,19 +1337,19 @@ discard block |
||
| 1337 | 1337 | </td> |
| 1338 | 1338 | </tr> |
| 1339 | 1339 | <?php |
| 1340 | - break; |
|
| 1340 | + break; |
|
| 1341 | 1341 | |
| 1342 | - case 'checkbox' : |
|
| 1342 | + case 'checkbox' : |
|
| 1343 | 1343 | |
| 1344 | - if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'start')) : |
|
| 1345 | - ?> |
|
| 1344 | + if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'start')) : |
|
| 1345 | + ?> |
|
| 1346 | 1346 | <tr valign="top"> |
| 1347 | 1347 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1348 | 1348 | <td class="forminp"> |
| 1349 | 1349 | <?php |
| 1350 | - endif; |
|
| 1350 | + endif; |
|
| 1351 | 1351 | |
| 1352 | - ?> |
|
| 1352 | + ?> |
|
| 1353 | 1353 | <fieldset> |
| 1354 | 1354 | <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend> |
| 1355 | 1355 | <label for="<?php echo $value['id'] ?>"> |
@@ -1359,49 +1359,49 @@ discard block |
||
| 1359 | 1359 | </fieldset> |
| 1360 | 1360 | <?php |
| 1361 | 1361 | |
| 1362 | - if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'end')) : |
|
| 1363 | - ?> |
|
| 1362 | + if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'end')) : |
|
| 1363 | + ?> |
|
| 1364 | 1364 | </td> |
| 1365 | 1365 | </tr> |
| 1366 | 1366 | <?php |
| 1367 | - endif; |
|
| 1367 | + endif; |
|
| 1368 | 1368 | |
| 1369 | - break; |
|
| 1369 | + break; |
|
| 1370 | 1370 | |
| 1371 | - case 'radio' : |
|
| 1371 | + case 'radio' : |
|
| 1372 | 1372 | |
| 1373 | - if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'start')) : |
|
| 1374 | - ?> |
|
| 1373 | + if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'start')) : |
|
| 1374 | + ?> |
|
| 1375 | 1375 | <tr valign="top"> |
| 1376 | 1376 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1377 | 1377 | <td class="forminp"> |
| 1378 | 1378 | <?php |
| 1379 | - endif; |
|
| 1379 | + endif; |
|
| 1380 | 1380 | |
| 1381 | - ?> |
|
| 1381 | + ?> |
|
| 1382 | 1382 | <fieldset> |
| 1383 | 1383 | <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend> |
| 1384 | 1384 | <label for="<?php echo $value['id'];?>"> |
| 1385 | 1385 | <input name="<?php echo esc_attr($value['id']); ?>" |
| 1386 | 1386 | id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio" |
| 1387 | 1387 | value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) {
|
| 1388 | - echo 'checked="checked"'; |
|
| 1389 | - }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
|
|
| 1388 | + echo 'checked="checked"'; |
|
| 1389 | + }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
|
|
| 1390 | 1390 | <?php echo $value['desc']; ?></label><br> |
| 1391 | 1391 | </fieldset> |
| 1392 | 1392 | <?php |
| 1393 | 1393 | |
| 1394 | - if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'end')) : |
|
| 1395 | - ?> |
|
| 1394 | + if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'end')) : |
|
| 1395 | + ?> |
|
| 1396 | 1396 | </td> |
| 1397 | 1397 | </tr> |
| 1398 | 1398 | <?php |
| 1399 | - endif; |
|
| 1399 | + endif; |
|
| 1400 | 1400 | |
| 1401 | - break; |
|
| 1401 | + break; |
|
| 1402 | 1402 | |
| 1403 | - case 'textarea': |
|
| 1404 | - ?> |
|
| 1403 | + case 'textarea': |
|
| 1404 | + ?> |
|
| 1405 | 1405 | <tr valign="top"> |
| 1406 | 1406 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1407 | 1407 | <td class="forminp"> |
@@ -1414,30 +1414,30 @@ discard block |
||
| 1414 | 1414 | |
| 1415 | 1415 | </td> |
| 1416 | 1416 | </tr><?php |
| 1417 | - break; |
|
| 1417 | + break; |
|
| 1418 | 1418 | |
| 1419 | - case 'editor': |
|
| 1420 | - ?> |
|
| 1419 | + case 'editor': |
|
| 1420 | + ?> |
|
| 1421 | 1421 | <tr valign="top"> |
| 1422 | 1422 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1423 | 1423 | <td class="forminp"><?php |
| 1424 | - if (get_option($value['id'])) |
|
| 1425 | - $content = stripslashes(get_option($value['id'])); |
|
| 1426 | - else |
|
| 1427 | - $content = $value['std']; |
|
| 1424 | + if (get_option($value['id'])) |
|
| 1425 | + $content = stripslashes(get_option($value['id'])); |
|
| 1426 | + else |
|
| 1427 | + $content = $value['std']; |
|
| 1428 | 1428 | |
| 1429 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 1429 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 1430 | 1430 | |
| 1431 | - wp_editor($content, esc_attr($value['id']), $editor_settings); |
|
| 1431 | + wp_editor($content, esc_attr($value['id']), $editor_settings); |
|
| 1432 | 1432 | |
| 1433 | - ?> <span class="description"><?php echo $value['desc'] ?></span> |
|
| 1433 | + ?> <span class="description"><?php echo $value['desc'] ?></span> |
|
| 1434 | 1434 | |
| 1435 | 1435 | </td> |
| 1436 | 1436 | </tr><?php |
| 1437 | - break; |
|
| 1437 | + break; |
|
| 1438 | 1438 | |
| 1439 | - case 'single_select_page' : |
|
| 1440 | - // WPML |
|
| 1439 | + case 'single_select_page' : |
|
| 1440 | + // WPML |
|
| 1441 | 1441 | $switch_lang = false; |
| 1442 | 1442 | $disabled = ''; |
| 1443 | 1443 | if (geodir_is_wpml() && isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'permalink_settings') {
|
@@ -1455,18 +1455,18 @@ discard block |
||
| 1455 | 1455 | // |
| 1456 | 1456 | $page_setting = (int)get_option($value['id']); |
| 1457 | 1457 | |
| 1458 | - $args = array('name' => $value['id'],
|
|
| 1459 | - 'id' => $value['id'], |
|
| 1460 | - 'sort_column' => 'menu_order', |
|
| 1461 | - 'sort_order' => 'ASC', |
|
| 1462 | - 'show_option_none' => ' ', |
|
| 1463 | - 'class' => $value['class'], |
|
| 1464 | - 'echo' => false, |
|
| 1465 | - 'selected' => $page_setting); |
|
| 1458 | + $args = array('name' => $value['id'],
|
|
| 1459 | + 'id' => $value['id'], |
|
| 1460 | + 'sort_column' => 'menu_order', |
|
| 1461 | + 'sort_order' => 'ASC', |
|
| 1462 | + 'show_option_none' => ' ', |
|
| 1463 | + 'class' => $value['class'], |
|
| 1464 | + 'echo' => false, |
|
| 1465 | + 'selected' => $page_setting); |
|
| 1466 | 1466 | |
| 1467 | - if (isset($value['args'])) $args = wp_parse_args($value['args'], $args); |
|
| 1467 | + if (isset($value['args'])) $args = wp_parse_args($value['args'], $args); |
|
| 1468 | 1468 | |
| 1469 | - ?> |
|
| 1469 | + ?> |
|
| 1470 | 1470 | <tr valign="top" class="single_select_page"> |
| 1471 | 1471 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1472 | 1472 | <td class="forminp"> |
@@ -1477,17 +1477,17 @@ discard block |
||
| 1477 | 1477 | if ($switch_lang) {
|
| 1478 | 1478 | $sitepress->switch_lang($switch_lang, true); |
| 1479 | 1479 | } |
| 1480 | - break; |
|
| 1481 | - case 'single_select_country' : |
|
| 1482 | - $country_setting = (string)get_option($value['id']); |
|
| 1483 | - if (strstr($country_setting, ':')) : |
|
| 1484 | - $country = current(explode(':', $country_setting));
|
|
| 1485 | - $state = end(explode(':', $country_setting));
|
|
| 1486 | - else : |
|
| 1487 | - $country = $country_setting; |
|
| 1488 | - $state = '*'; |
|
| 1489 | - endif; |
|
| 1490 | - ?> |
|
| 1480 | + break; |
|
| 1481 | + case 'single_select_country' : |
|
| 1482 | + $country_setting = (string)get_option($value['id']); |
|
| 1483 | + if (strstr($country_setting, ':')) : |
|
| 1484 | + $country = current(explode(':', $country_setting));
|
|
| 1485 | + $state = end(explode(':', $country_setting));
|
|
| 1486 | + else : |
|
| 1487 | + $country = $country_setting; |
|
| 1488 | + $state = '*'; |
|
| 1489 | + endif; |
|
| 1490 | + ?> |
|
| 1491 | 1491 | <tr valign="top"> |
| 1492 | 1492 | <th scope="rpw" class="titledesc"><?php echo $value['name'] ?></th> |
| 1493 | 1493 | <td class="forminp"><select name="<?php echo esc_attr($value['id']); ?>" |
@@ -1498,12 +1498,12 @@ discard block |
||
| 1498 | 1498 | </select> <span class="description"><?php echo $value['desc'] ?></span> |
| 1499 | 1499 | </td> |
| 1500 | 1500 | </tr><?php |
| 1501 | - break; |
|
| 1502 | - case 'multi_select_countries' : |
|
| 1503 | - $countries = $geodirectory->countries->countries; |
|
| 1504 | - asort($countries); |
|
| 1505 | - $selections = (array)get_option($value['id']); |
|
| 1506 | - ?> |
|
| 1501 | + break; |
|
| 1502 | + case 'multi_select_countries' : |
|
| 1503 | + $countries = $geodirectory->countries->countries; |
|
| 1504 | + asort($countries); |
|
| 1505 | + $selections = (array)get_option($value['id']); |
|
| 1506 | + ?> |
|
| 1507 | 1507 | <tr valign="top"> |
| 1508 | 1508 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1509 | 1509 | <td class="forminp"> |
@@ -1511,21 +1511,21 @@ discard block |
||
| 1511 | 1511 | data-placeholder="<?php _e('Choose countries…', 'geodirectory'); ?>"
|
| 1512 | 1512 | title="Country" class="chosen_select"> |
| 1513 | 1513 | <?php |
| 1514 | - if ($countries) foreach ($countries as $key => $val) : |
|
| 1515 | - echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
| 1516 | - endforeach; |
|
| 1517 | - ?> |
|
| 1514 | + if ($countries) foreach ($countries as $key => $val) : |
|
| 1515 | + echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
| 1516 | + endforeach; |
|
| 1517 | + ?> |
|
| 1518 | 1518 | </select> |
| 1519 | 1519 | </td> |
| 1520 | 1520 | </tr> |
| 1521 | 1521 | |
| 1522 | 1522 | <?php |
| 1523 | 1523 | |
| 1524 | - break; |
|
| 1524 | + break; |
|
| 1525 | 1525 | |
| 1526 | - case 'google_analytics' : |
|
| 1527 | - $selections = (array)get_option($value['id']); |
|
| 1528 | - ?> |
|
| 1526 | + case 'google_analytics' : |
|
| 1527 | + $selections = (array)get_option($value['id']); |
|
| 1528 | + ?> |
|
| 1529 | 1529 | <tr valign="top"> |
| 1530 | 1530 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1531 | 1531 | <td class="forminp"> |
@@ -1533,59 +1533,59 @@ discard block |
||
| 1533 | 1533 | |
| 1534 | 1534 | <?php |
| 1535 | 1535 | |
| 1536 | - $oAuthURL = "https://accounts.google.com/o/oauth2/auth?"; |
|
| 1537 | - $scope = "scope=https://www.googleapis.com/auth/analytics.readonly"; |
|
| 1538 | - $state = "&state=123";//any string |
|
| 1539 | - $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
|
|
| 1540 | - $response_type = "&response_type=code"; |
|
| 1541 | - $client_id = "&client_id=".get_option('geodir_ga_client_id');
|
|
| 1542 | - $access_type = "&access_type=offline"; |
|
| 1543 | - $approval_prompt = "&approval_prompt=force"; |
|
| 1536 | + $oAuthURL = "https://accounts.google.com/o/oauth2/auth?"; |
|
| 1537 | + $scope = "scope=https://www.googleapis.com/auth/analytics.readonly"; |
|
| 1538 | + $state = "&state=123";//any string |
|
| 1539 | + $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
|
|
| 1540 | + $response_type = "&response_type=code"; |
|
| 1541 | + $client_id = "&client_id=".get_option('geodir_ga_client_id');
|
|
| 1542 | + $access_type = "&access_type=offline"; |
|
| 1543 | + $approval_prompt = "&approval_prompt=force"; |
|
| 1544 | 1544 | |
| 1545 | - $auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt; |
|
| 1545 | + $auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt; |
|
| 1546 | 1546 | |
| 1547 | 1547 | |
| 1548 | - if (get_option('geodir_ga_auth_token')) {
|
|
| 1549 | - ?> |
|
| 1548 | + if (get_option('geodir_ga_auth_token')) {
|
|
| 1549 | + ?> |
|
| 1550 | 1550 | <span class="button-primary" |
| 1551 | 1551 | onclick="window.open('<?php echo geodir_ga_activation_url();?>', 'activate','width=700, height=600, menubar=0, status=0, location=0, toolbar=0')"><?php _e('Re-authorize', 'geodirectory'); ?></span>
|
| 1552 | 1552 | <span |
| 1553 | 1553 | style="color: green; font-weight: bold;"><?php _e('Authorized', 'geodirectory'); ?></span>
|
| 1554 | 1554 | <?php |
| 1555 | - } else {
|
|
| 1556 | - ?> |
|
| 1555 | + } else {
|
|
| 1556 | + ?> |
|
| 1557 | 1557 | <span class="button-primary" |
| 1558 | 1558 | onclick="window.open('<?php echo geodir_ga_activation_url();?>', 'activate','width=700, height=600, menubar=0, status=0, location=0, toolbar=0')"><?php _e('Authorize', 'geodirectory');?></span>
|
| 1559 | 1559 | <?php |
| 1560 | - } |
|
| 1561 | - ?> |
|
| 1560 | + } |
|
| 1561 | + ?> |
|
| 1562 | 1562 | </td> |
| 1563 | 1563 | </tr> |
| 1564 | 1564 | |
| 1565 | 1565 | <?php |
| 1566 | 1566 | |
| 1567 | 1567 | |
| 1568 | - break; |
|
| 1568 | + break; |
|
| 1569 | 1569 | |
| 1570 | - case 'field_seperator' : |
|
| 1570 | + case 'field_seperator' : |
|
| 1571 | 1571 | |
| 1572 | - ?> |
|
| 1572 | + ?> |
|
| 1573 | 1573 | <tr valign="top"> |
| 1574 | 1574 | <td colspan="2" class="forminp geodir_line_seperator"></td> |
| 1575 | 1575 | </tr> |
| 1576 | 1576 | <?php |
| 1577 | 1577 | |
| 1578 | - break; |
|
| 1578 | + break; |
|
| 1579 | 1579 | |
| 1580 | - endswitch; |
|
| 1580 | + endswitch; |
|
| 1581 | 1581 | |
| 1582 | - endforeach; |
|
| 1582 | + endforeach; |
|
| 1583 | 1583 | |
| 1584 | - if ($first_title === false) {
|
|
| 1585 | - echo "</div>"; |
|
| 1586 | - } |
|
| 1584 | + if ($first_title === false) {
|
|
| 1585 | + echo "</div>"; |
|
| 1586 | + } |
|
| 1587 | 1587 | |
| 1588 | - ?> |
|
| 1588 | + ?> |
|
| 1589 | 1589 | |
| 1590 | 1590 | <script type="text/javascript"> |
| 1591 | 1591 | |
@@ -1645,33 +1645,33 @@ discard block |
||
| 1645 | 1645 | */ |
| 1646 | 1646 | function geodir_post_info_setting() |
| 1647 | 1647 | {
|
| 1648 | - global $post, $post_id; |
|
| 1649 | - |
|
| 1650 | - $post_type = get_post_type(); |
|
| 1651 | - |
|
| 1652 | - $package_info = array(); |
|
| 1653 | - |
|
| 1654 | - $package_info = geodir_post_package_info($package_info, $post, $post_type); |
|
| 1655 | - wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_info_noncename'); |
|
| 1656 | - echo '<div id="geodir_wrapper">'; |
|
| 1657 | - /** |
|
| 1658 | - * Called before the GD custom fields are output in the wp-admin area. |
|
| 1659 | - * |
|
| 1660 | - * @since 1.0.0 |
|
| 1661 | - * @see 'geodir_after_default_field_in_meta_box' |
|
| 1662 | - */ |
|
| 1663 | - do_action('geodir_before_default_field_in_meta_box');
|
|
| 1664 | - //geodir_get_custom_fields_html($package_info->pid,'default',$post_type); |
|
| 1665 | - // to display all fields in one information box |
|
| 1666 | - geodir_get_custom_fields_html($package_info->pid, 'all', $post_type); |
|
| 1667 | - /** |
|
| 1668 | - * Called after the GD custom fields are output in the wp-admin area. |
|
| 1669 | - * |
|
| 1670 | - * @since 1.0.0 |
|
| 1671 | - * @see 'geodir_before_default_field_in_meta_box' |
|
| 1672 | - */ |
|
| 1673 | - do_action('geodir_after_default_field_in_meta_box');
|
|
| 1674 | - echo '</div>'; |
|
| 1648 | + global $post, $post_id; |
|
| 1649 | + |
|
| 1650 | + $post_type = get_post_type(); |
|
| 1651 | + |
|
| 1652 | + $package_info = array(); |
|
| 1653 | + |
|
| 1654 | + $package_info = geodir_post_package_info($package_info, $post, $post_type); |
|
| 1655 | + wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_info_noncename'); |
|
| 1656 | + echo '<div id="geodir_wrapper">'; |
|
| 1657 | + /** |
|
| 1658 | + * Called before the GD custom fields are output in the wp-admin area. |
|
| 1659 | + * |
|
| 1660 | + * @since 1.0.0 |
|
| 1661 | + * @see 'geodir_after_default_field_in_meta_box' |
|
| 1662 | + */ |
|
| 1663 | + do_action('geodir_before_default_field_in_meta_box');
|
|
| 1664 | + //geodir_get_custom_fields_html($package_info->pid,'default',$post_type); |
|
| 1665 | + // to display all fields in one information box |
|
| 1666 | + geodir_get_custom_fields_html($package_info->pid, 'all', $post_type); |
|
| 1667 | + /** |
|
| 1668 | + * Called after the GD custom fields are output in the wp-admin area. |
|
| 1669 | + * |
|
| 1670 | + * @since 1.0.0 |
|
| 1671 | + * @see 'geodir_before_default_field_in_meta_box' |
|
| 1672 | + */ |
|
| 1673 | + do_action('geodir_after_default_field_in_meta_box');
|
|
| 1674 | + echo '</div>'; |
|
| 1675 | 1675 | } |
| 1676 | 1676 | |
| 1677 | 1677 | /** |
@@ -1684,18 +1684,18 @@ discard block |
||
| 1684 | 1684 | */ |
| 1685 | 1685 | function geodir_post_addinfo_setting() |
| 1686 | 1686 | {
|
| 1687 | - global $post, $post_id; |
|
| 1687 | + global $post, $post_id; |
|
| 1688 | 1688 | |
| 1689 | - $post_type = get_post_type(); |
|
| 1689 | + $post_type = get_post_type(); |
|
| 1690 | 1690 | |
| 1691 | - $package_info = array(); |
|
| 1691 | + $package_info = array(); |
|
| 1692 | 1692 | |
| 1693 | - $package_info = geodir_post_package_info($package_info, $post, $post_type); |
|
| 1693 | + $package_info = geodir_post_package_info($package_info, $post, $post_type); |
|
| 1694 | 1694 | |
| 1695 | - wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_addinfo_noncename'); |
|
| 1696 | - echo '<div id="geodir_wrapper">'; |
|
| 1697 | - geodir_get_custom_fields_html($package_info->pid, 'custom', $post_type); |
|
| 1698 | - echo '</div>'; |
|
| 1695 | + wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_addinfo_noncename'); |
|
| 1696 | + echo '<div id="geodir_wrapper">'; |
|
| 1697 | + geodir_get_custom_fields_html($package_info->pid, 'custom', $post_type); |
|
| 1698 | + echo '</div>'; |
|
| 1699 | 1699 | |
| 1700 | 1700 | } |
| 1701 | 1701 | |
@@ -1709,60 +1709,60 @@ discard block |
||
| 1709 | 1709 | */ |
| 1710 | 1710 | function geodir_post_attachments() |
| 1711 | 1711 | {
|
| 1712 | - global $post, $post_id; |
|
| 1712 | + global $post, $post_id; |
|
| 1713 | 1713 | |
| 1714 | - wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename'); |
|
| 1714 | + wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename'); |
|
| 1715 | 1715 | |
| 1716 | - if (geodir_get_featured_image($post_id, 'thumbnail')) {
|
|
| 1717 | - echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>';
|
|
| 1718 | - geodir_show_featured_image($post_id, 'thumbnail'); |
|
| 1719 | - } |
|
| 1716 | + if (geodir_get_featured_image($post_id, 'thumbnail')) {
|
|
| 1717 | + echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>';
|
|
| 1718 | + geodir_show_featured_image($post_id, 'thumbnail'); |
|
| 1719 | + } |
|
| 1720 | 1720 | |
| 1721 | - $image_limit = 0; |
|
| 1721 | + $image_limit = 0; |
|
| 1722 | 1722 | |
| 1723 | - ?> |
|
| 1723 | + ?> |
|
| 1724 | 1724 | |
| 1725 | 1725 | |
| 1726 | 1726 | <h5 class="form_title"> |
| 1727 | 1727 | <?php if ($image_limit != 0 && $image_limit == 1) {
|
| 1728 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 1729 | - } ?> |
|
| 1728 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 1729 | + } ?> |
|
| 1730 | 1730 | <?php if ($image_limit != 0 && $image_limit > 1) {
|
| 1731 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 1732 | - } ?> |
|
| 1731 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 1732 | + } ?> |
|
| 1733 | 1733 | <?php if ($image_limit == 0) {
|
| 1734 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 1735 | - } ?> |
|
| 1734 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 1735 | + } ?> |
|
| 1736 | 1736 | </h5> |
| 1737 | 1737 | |
| 1738 | 1738 | |
| 1739 | 1739 | <?php |
| 1740 | 1740 | |
| 1741 | - $curImages = geodir_get_images($post_id); |
|
| 1742 | - $place_img_array = array(); |
|
| 1741 | + $curImages = geodir_get_images($post_id); |
|
| 1742 | + $place_img_array = array(); |
|
| 1743 | 1743 | |
| 1744 | - if (!empty($curImages)): |
|
| 1745 | - foreach ($curImages as $p_img): |
|
| 1746 | - $place_img_array[] = $p_img->src; |
|
| 1747 | - endforeach; |
|
| 1748 | - endif; |
|
| 1744 | + if (!empty($curImages)): |
|
| 1745 | + foreach ($curImages as $p_img): |
|
| 1746 | + $place_img_array[] = $p_img->src; |
|
| 1747 | + endforeach; |
|
| 1748 | + endif; |
|
| 1749 | 1749 | |
| 1750 | - if (!empty($place_img_array)) |
|
| 1751 | - $curImages = implode(',', $place_img_array);
|
|
| 1750 | + if (!empty($place_img_array)) |
|
| 1751 | + $curImages = implode(',', $place_img_array);
|
|
| 1752 | 1752 | |
| 1753 | 1753 | |
| 1754 | - // adjust values here |
|
| 1755 | - $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
| 1754 | + // adjust values here |
|
| 1755 | + $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
| 1756 | 1756 | |
| 1757 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 1757 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 1758 | 1758 | |
| 1759 | - $multiple = true; // allow multiple files upload |
|
| 1759 | + $multiple = true; // allow multiple files upload |
|
| 1760 | 1760 | |
| 1761 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 1761 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 1762 | 1762 | |
| 1763 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 1763 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 1764 | 1764 | |
| 1765 | - ?> |
|
| 1765 | + ?> |
|
| 1766 | 1766 | |
| 1767 | 1767 | <div class="gtd-form_row clearfix" id="<?php echo $id; ?>dropbox" style="border:1px solid #999999;padding:5px;text-align:center;"> |
| 1768 | 1768 | <input type="hidden" name="<?php echo $id; ?>" id="<?php echo $id; ?>" value="<?php echo $svalue; ?>"/> |
@@ -1804,13 +1804,13 @@ discard block |
||
| 1804 | 1804 | */ |
| 1805 | 1805 | function geodir_action_post_updated($post_ID, $post_after, $post_before) |
| 1806 | 1806 | {
|
| 1807 | - $post_type = get_post_type($post_ID); |
|
| 1807 | + $post_type = get_post_type($post_ID); |
|
| 1808 | 1808 | |
| 1809 | - if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
|
|
| 1810 | - if ($post_type != '' && in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_ID) && !empty($post_after->post_title) && $post_after->post_title != $post_before->post_title) {
|
|
| 1811 | - geodir_save_post_meta($post_ID, 'post_title', $post_after->post_title); |
|
| 1812 | - } |
|
| 1813 | - } |
|
| 1809 | + if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
|
|
| 1810 | + if ($post_type != '' && in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_ID) && !empty($post_after->post_title) && $post_after->post_title != $post_before->post_title) {
|
|
| 1811 | + geodir_save_post_meta($post_ID, 'post_title', $post_after->post_title); |
|
| 1812 | + } |
|
| 1813 | + } |
|
| 1814 | 1814 | } |
| 1815 | 1815 | |
| 1816 | 1816 | /** |
@@ -1825,39 +1825,39 @@ discard block |
||
| 1825 | 1825 | */ |
| 1826 | 1826 | function geodir_notification_add_bcc_option($settings) |
| 1827 | 1827 | {
|
| 1828 | - if (!empty($settings)) {
|
|
| 1829 | - $new_settings = array(); |
|
| 1830 | - foreach ($settings as $setting) {
|
|
| 1831 | - if (isset($setting['id']) && $setting['id'] == 'site_bcc_options' && isset($setting['type']) && $setting['type'] == 'sectionend') {
|
|
| 1832 | - $geodir_bcc_listing_published_yes = array( |
|
| 1833 | - 'name' => __('Listing published', 'geodirectory'),
|
|
| 1834 | - 'desc' => __('Yes', 'geodirectory'),
|
|
| 1835 | - 'id' => 'geodir_bcc_listing_published', |
|
| 1836 | - 'std' => 'yes', |
|
| 1837 | - 'type' => 'radio', |
|
| 1838 | - 'value' => '1', |
|
| 1839 | - 'radiogroup' => 'start' |
|
| 1840 | - ); |
|
| 1841 | - |
|
| 1842 | - $geodir_bcc_listing_published_no = array( |
|
| 1843 | - 'name' => __('Listing published', 'geodirectory'),
|
|
| 1844 | - 'desc' => __('No', 'geodirectory'),
|
|
| 1845 | - 'id' => 'geodir_bcc_listing_published', |
|
| 1846 | - 'std' => 'yes', |
|
| 1847 | - 'type' => 'radio', |
|
| 1848 | - 'value' => '0', |
|
| 1849 | - 'radiogroup' => 'end' |
|
| 1850 | - ); |
|
| 1851 | - |
|
| 1852 | - $new_settings[] = $geodir_bcc_listing_published_yes; |
|
| 1853 | - $new_settings[] = $geodir_bcc_listing_published_no; |
|
| 1854 | - } |
|
| 1855 | - $new_settings[] = $setting; |
|
| 1856 | - } |
|
| 1857 | - $settings = $new_settings; |
|
| 1858 | - } |
|
| 1828 | + if (!empty($settings)) {
|
|
| 1829 | + $new_settings = array(); |
|
| 1830 | + foreach ($settings as $setting) {
|
|
| 1831 | + if (isset($setting['id']) && $setting['id'] == 'site_bcc_options' && isset($setting['type']) && $setting['type'] == 'sectionend') {
|
|
| 1832 | + $geodir_bcc_listing_published_yes = array( |
|
| 1833 | + 'name' => __('Listing published', 'geodirectory'),
|
|
| 1834 | + 'desc' => __('Yes', 'geodirectory'),
|
|
| 1835 | + 'id' => 'geodir_bcc_listing_published', |
|
| 1836 | + 'std' => 'yes', |
|
| 1837 | + 'type' => 'radio', |
|
| 1838 | + 'value' => '1', |
|
| 1839 | + 'radiogroup' => 'start' |
|
| 1840 | + ); |
|
| 1841 | + |
|
| 1842 | + $geodir_bcc_listing_published_no = array( |
|
| 1843 | + 'name' => __('Listing published', 'geodirectory'),
|
|
| 1844 | + 'desc' => __('No', 'geodirectory'),
|
|
| 1845 | + 'id' => 'geodir_bcc_listing_published', |
|
| 1846 | + 'std' => 'yes', |
|
| 1847 | + 'type' => 'radio', |
|
| 1848 | + 'value' => '0', |
|
| 1849 | + 'radiogroup' => 'end' |
|
| 1850 | + ); |
|
| 1851 | + |
|
| 1852 | + $new_settings[] = $geodir_bcc_listing_published_yes; |
|
| 1853 | + $new_settings[] = $geodir_bcc_listing_published_no; |
|
| 1854 | + } |
|
| 1855 | + $new_settings[] = $setting; |
|
| 1856 | + } |
|
| 1857 | + $settings = $new_settings; |
|
| 1858 | + } |
|
| 1859 | 1859 | |
| 1860 | - return $settings; |
|
| 1860 | + return $settings; |
|
| 1861 | 1861 | } |
| 1862 | 1862 | |
| 1863 | 1863 | |
@@ -1872,19 +1872,19 @@ discard block |
||
| 1872 | 1872 | */ |
| 1873 | 1873 | function get_gd_theme_compat_callback() |
| 1874 | 1874 | {
|
| 1875 | - global $wpdb; |
|
| 1876 | - $themes = get_option('gd_theme_compats');
|
|
| 1877 | - |
|
| 1878 | - if (isset($_POST['theme']) && isset($themes[$_POST['theme']]) && !empty($themes[$_POST['theme']])) {
|
|
| 1879 | - if (isset($_POST['export'])) {
|
|
| 1880 | - echo json_encode(array($_POST['theme'] => $themes[$_POST['theme']])); |
|
| 1881 | - } else {
|
|
| 1882 | - echo json_encode($themes[$_POST['theme']]); |
|
| 1883 | - } |
|
| 1875 | + global $wpdb; |
|
| 1876 | + $themes = get_option('gd_theme_compats');
|
|
| 1884 | 1877 | |
| 1885 | - } |
|
| 1878 | + if (isset($_POST['theme']) && isset($themes[$_POST['theme']]) && !empty($themes[$_POST['theme']])) {
|
|
| 1879 | + if (isset($_POST['export'])) {
|
|
| 1880 | + echo json_encode(array($_POST['theme'] => $themes[$_POST['theme']])); |
|
| 1881 | + } else {
|
|
| 1882 | + echo json_encode($themes[$_POST['theme']]); |
|
| 1883 | + } |
|
| 1884 | + |
|
| 1885 | + } |
|
| 1886 | 1886 | |
| 1887 | - die(); |
|
| 1887 | + die(); |
|
| 1888 | 1888 | } |
| 1889 | 1889 | |
| 1890 | 1890 | add_action('wp_ajax_get_gd_theme_compat_import_callback', 'get_gd_theme_compat_import_callback');
|
@@ -1898,20 +1898,20 @@ discard block |
||
| 1898 | 1898 | */ |
| 1899 | 1899 | function get_gd_theme_compat_import_callback() |
| 1900 | 1900 | {
|
| 1901 | - global $wpdb; |
|
| 1902 | - $themes = get_option('gd_theme_compats');
|
|
| 1903 | - if (isset($_POST['theme']) && !empty($_POST['theme'])) {
|
|
| 1904 | - $json = json_decode(stripslashes($_POST['theme']), true); |
|
| 1905 | - if (!empty($json) && is_array($json)) {
|
|
| 1906 | - $key = sanitize_text_field(key($json)); |
|
| 1907 | - $themes[$key] = $json[$key]; |
|
| 1908 | - update_option('gd_theme_compats', $themes);
|
|
| 1909 | - echo $key; |
|
| 1910 | - die(); |
|
| 1911 | - } |
|
| 1912 | - } |
|
| 1913 | - echo '0'; |
|
| 1914 | - die(); |
|
| 1901 | + global $wpdb; |
|
| 1902 | + $themes = get_option('gd_theme_compats');
|
|
| 1903 | + if (isset($_POST['theme']) && !empty($_POST['theme'])) {
|
|
| 1904 | + $json = json_decode(stripslashes($_POST['theme']), true); |
|
| 1905 | + if (!empty($json) && is_array($json)) {
|
|
| 1906 | + $key = sanitize_text_field(key($json)); |
|
| 1907 | + $themes[$key] = $json[$key]; |
|
| 1908 | + update_option('gd_theme_compats', $themes);
|
|
| 1909 | + echo $key; |
|
| 1910 | + die(); |
|
| 1911 | + } |
|
| 1912 | + } |
|
| 1913 | + echo '0'; |
|
| 1914 | + die(); |
|
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | 1917 | |
@@ -1924,39 +1924,39 @@ discard block |
||
| 1924 | 1924 | */ |
| 1925 | 1925 | function gd_set_theme_compat() |
| 1926 | 1926 | {
|
| 1927 | - global $wpdb; |
|
| 1928 | - $theme = wp_get_theme(); |
|
| 1927 | + global $wpdb; |
|
| 1928 | + $theme = wp_get_theme(); |
|
| 1929 | 1929 | |
| 1930 | - if ($theme->parent()) {
|
|
| 1931 | - $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
|
|
| 1932 | - } else {
|
|
| 1933 | - $theme_name = str_replace(" ", "_", $theme->get('Name'));
|
|
| 1934 | - } |
|
| 1930 | + if ($theme->parent()) {
|
|
| 1931 | + $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
|
|
| 1932 | + } else {
|
|
| 1933 | + $theme_name = str_replace(" ", "_", $theme->get('Name'));
|
|
| 1934 | + } |
|
| 1935 | 1935 | |
| 1936 | - $theme_compats = get_option('gd_theme_compats');
|
|
| 1937 | - $current_compat = get_option('gd_theme_compat');
|
|
| 1938 | - $current_compat = str_replace("_custom", "", $current_compat);
|
|
| 1936 | + $theme_compats = get_option('gd_theme_compats');
|
|
| 1937 | + $current_compat = get_option('gd_theme_compat');
|
|
| 1938 | + $current_compat = str_replace("_custom", "", $current_compat);
|
|
| 1939 | 1939 | |
| 1940 | - if ($current_compat == $theme_name && strpos("_custom", get_option('gd_theme_compat')) !== false) {
|
|
| 1941 | - return; |
|
| 1942 | - }// if already running correct compat then bail |
|
| 1940 | + if ($current_compat == $theme_name && strpos("_custom", get_option('gd_theme_compat')) !== false) {
|
|
| 1941 | + return; |
|
| 1942 | + }// if already running correct compat then bail |
|
| 1943 | 1943 | |
| 1944 | - if (isset($theme_compats[$theme_name])) {// if there is a compat avail then set it
|
|
| 1945 | - update_option('gd_theme_compat', $theme_name);
|
|
| 1946 | - update_option('theme_compatibility_setting', $theme_compats[$theme_name]);
|
|
| 1944 | + if (isset($theme_compats[$theme_name])) {// if there is a compat avail then set it
|
|
| 1945 | + update_option('gd_theme_compat', $theme_name);
|
|
| 1946 | + update_option('theme_compatibility_setting', $theme_compats[$theme_name]);
|
|
| 1947 | 1947 | |
| 1948 | - // if there are default options to set then set them |
|
| 1949 | - if (isset($theme_compats[$theme_name]['geodir_theme_compat_default_options']) && !empty($theme_compats[$theme_name]['geodir_theme_compat_default_options'])) {
|
|
| 1948 | + // if there are default options to set then set them |
|
| 1949 | + if (isset($theme_compats[$theme_name]['geodir_theme_compat_default_options']) && !empty($theme_compats[$theme_name]['geodir_theme_compat_default_options'])) {
|
|
| 1950 | 1950 | |
| 1951 | - foreach ($theme_compats[$theme_name]['geodir_theme_compat_default_options'] as $key => $val) {
|
|
| 1952 | - update_option($key, $val); |
|
| 1953 | - } |
|
| 1954 | - } |
|
| 1951 | + foreach ($theme_compats[$theme_name]['geodir_theme_compat_default_options'] as $key => $val) {
|
|
| 1952 | + update_option($key, $val); |
|
| 1953 | + } |
|
| 1954 | + } |
|
| 1955 | 1955 | |
| 1956 | - } else {
|
|
| 1957 | - update_option('gd_theme_compat', '');
|
|
| 1958 | - update_option('theme_compatibility_setting', '');
|
|
| 1959 | - } |
|
| 1956 | + } else {
|
|
| 1957 | + update_option('gd_theme_compat', '');
|
|
| 1958 | + update_option('theme_compatibility_setting', '');
|
|
| 1959 | + } |
|
| 1960 | 1960 | |
| 1961 | 1961 | |
| 1962 | 1962 | } |
@@ -1971,9 +1971,9 @@ discard block |
||
| 1971 | 1971 | */ |
| 1972 | 1972 | function gd_check_avada_compat() |
| 1973 | 1973 | {
|
| 1974 | - if (function_exists('avada_load_textdomain') && !get_option('avada_nag')) {
|
|
| 1975 | - add_action('admin_notices', 'gd_avada_compat_warning');
|
|
| 1976 | - } |
|
| 1974 | + if (function_exists('avada_load_textdomain') && !get_option('avada_nag')) {
|
|
| 1975 | + add_action('admin_notices', 'gd_avada_compat_warning');
|
|
| 1976 | + } |
|
| 1977 | 1977 | } |
| 1978 | 1978 | |
| 1979 | 1979 | |
@@ -1986,22 +1986,22 @@ discard block |
||
| 1986 | 1986 | function gd_avada_compat_warning() |
| 1987 | 1987 | {
|
| 1988 | 1988 | |
| 1989 | - /* |
|
| 1989 | + /* |
|
| 1990 | 1990 | $msg_type = error |
| 1991 | 1991 | $msg_type = updated fade |
| 1992 | 1992 | $msg_type = update-nag |
| 1993 | 1993 | */ |
| 1994 | 1994 | |
| 1995 | - $plugin = 'avada-nag'; |
|
| 1996 | - $timestamp = 'avada-nag1234'; |
|
| 1997 | - $message = __('Welcome to GeoDirectory, please have a look <a href="https://docs.wpgeodirectory.com/category/getting-started/" target="_blank">here</a> to get started. :)', 'geodirectory');
|
|
| 1998 | - echo '<div id="' . $timestamp . '" class="error">'; |
|
| 1999 | - echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>'; |
|
| 2000 | - echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > ";
|
|
| 2001 | - echo "<p>$message</p>"; |
|
| 2002 | - echo "</div>"; |
|
| 1995 | + $plugin = 'avada-nag'; |
|
| 1996 | + $timestamp = 'avada-nag1234'; |
|
| 1997 | + $message = __('Welcome to GeoDirectory, please have a look <a href="https://docs.wpgeodirectory.com/category/getting-started/" target="_blank">here</a> to get started. :)', 'geodirectory');
|
|
| 1998 | + echo '<div id="' . $timestamp . '" class="error">'; |
|
| 1999 | + echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>'; |
|
| 2000 | + echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > ";
|
|
| 2001 | + echo "<p>$message</p>"; |
|
| 2002 | + echo "</div>"; |
|
| 2003 | 2003 | |
| 2004 | - ?> |
|
| 2004 | + ?> |
|
| 2005 | 2005 | <script> |
| 2006 | 2006 | function gdRemoveANotification($plugin, $timestamp) {
|
| 2007 | 2007 | |
@@ -2069,10 +2069,10 @@ discard block |
||
| 2069 | 2069 | */ |
| 2070 | 2070 | function geodir_avada_remove_notification() |
| 2071 | 2071 | {
|
| 2072 | - update_option('avada_nag', TRUE);
|
|
| 2072 | + update_option('avada_nag', TRUE);
|
|
| 2073 | 2073 | |
| 2074 | - // Always die in functions echoing ajax content |
|
| 2075 | - die(); |
|
| 2074 | + // Always die in functions echoing ajax content |
|
| 2075 | + die(); |
|
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | 2078 | |
@@ -2094,9 +2094,9 @@ discard block |
||
| 2094 | 2094 | global $post, $typenow, $current_screen; |
| 2095 | 2095 | |
| 2096 | 2096 | $post_type = NULL; |
| 2097 | - if (isset($_REQUEST['post']) && get_post_type($_REQUEST['post'])) |
|
| 2097 | + if (isset($_REQUEST['post']) && get_post_type($_REQUEST['post'])) |
|
| 2098 | 2098 | $post_type = get_post_type($_REQUEST['post']); |
| 2099 | - elseif ($post && isset($post->post_type)) |
|
| 2099 | + elseif ($post && isset($post->post_type)) |
|
| 2100 | 2100 | $post_type = $post->post_type; |
| 2101 | 2101 | elseif ($typenow) |
| 2102 | 2102 | $post_type = $typenow; |
@@ -2131,7 +2131,7 @@ discard block |
||
| 2131 | 2131 | // Don't allow same slug url for listing and location |
| 2132 | 2132 | if (geodir_strtolower($listing_prefix) == geodir_strtolower($location_prefix)) {
|
| 2133 | 2133 | $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab . '&msg=fail&gderr=21');
|
| 2134 | - wp_redirect($redirect_url); |
|
| 2134 | + wp_redirect($redirect_url); |
|
| 2135 | 2135 | exit; |
| 2136 | 2136 | } |
| 2137 | 2137 | |
@@ -2161,10 +2161,10 @@ discard block |
||
| 2161 | 2161 | * @package GeoDirectory |
| 2162 | 2162 | */ |
| 2163 | 2163 | function geodir_hide_admin_preview_button() {
|
| 2164 | - global $post_type; |
|
| 2165 | - $post_types = geodir_get_posttypes(); |
|
| 2166 | - if(in_array($post_type, $post_types)) |
|
| 2167 | - echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
|
|
| 2164 | + global $post_type; |
|
| 2165 | + $post_types = geodir_get_posttypes(); |
|
| 2166 | + if(in_array($post_type, $post_types)) |
|
| 2167 | + echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
|
|
| 2168 | 2168 | } |
| 2169 | 2169 | add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' ); |
| 2170 | 2170 | add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' ); |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | */ |
| 2180 | 2180 | function geodir_import_export_tab( $tabs ) {
|
| 2181 | 2181 | $tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) ); |
| 2182 | - return $tabs; |
|
| 2182 | + return $tabs; |
|
| 2183 | 2183 | } |
| 2184 | 2184 | |
| 2185 | 2185 | /** |
@@ -2194,26 +2194,26 @@ discard block |
||
| 2194 | 2194 | function geodir_import_export_page() {
|
| 2195 | 2195 | $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
| 2196 | 2196 | $gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv'; |
| 2197 | - /** |
|
| 2198 | - * Filter sample category data csv file url. |
|
| 2199 | - * |
|
| 2200 | - * @since 1.0.0 |
|
| 2201 | - * @package GeoDirectory |
|
| 2202 | - * |
|
| 2203 | - * @param string $gd_cats_sample_csv Sample category data csv file url. |
|
| 2204 | - */ |
|
| 2197 | + /** |
|
| 2198 | + * Filter sample category data csv file url. |
|
| 2199 | + * |
|
| 2200 | + * @since 1.0.0 |
|
| 2201 | + * @package GeoDirectory |
|
| 2202 | + * |
|
| 2203 | + * @param string $gd_cats_sample_csv Sample category data csv file url. |
|
| 2204 | + */ |
|
| 2205 | 2205 | $gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv ); |
| 2206 | 2206 | |
| 2207 | 2207 | $gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv'; |
| 2208 | - /** |
|
| 2209 | - * Filter sample post data csv file url. |
|
| 2210 | - * |
|
| 2211 | - * @since 1.0.0 |
|
| 2212 | - * @package GeoDirectory |
|
| 2213 | - * |
|
| 2214 | - * @param string $gd_posts_sample_csv Sample post data csv file url. |
|
| 2215 | - */ |
|
| 2216 | - $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv ); |
|
| 2208 | + /** |
|
| 2209 | + * Filter sample post data csv file url. |
|
| 2210 | + * |
|
| 2211 | + * @since 1.0.0 |
|
| 2212 | + * @package GeoDirectory |
|
| 2213 | + * |
|
| 2214 | + * @param string $gd_posts_sample_csv Sample post data csv file url. |
|
| 2215 | + */ |
|
| 2216 | + $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv ); |
|
| 2217 | 2217 | |
| 2218 | 2218 | $gd_posttypes = geodir_get_posttypes( 'array' ); |
| 2219 | 2219 | |
@@ -2236,14 +2236,14 @@ discard block |
||
| 2236 | 2236 | $gd_chunksize_options[100000] = 100000; |
| 2237 | 2237 | |
| 2238 | 2238 | /** |
| 2239 | - * Filter max entries per export csv file. |
|
| 2240 | - * |
|
| 2241 | - * @since 1.5.6 |
|
| 2242 | - * @package GeoDirectory |
|
| 2243 | - * |
|
| 2244 | - * @param string $gd_chunksize_options Entries options. |
|
| 2245 | - */ |
|
| 2246 | - $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options ); |
|
| 2239 | + * Filter max entries per export csv file. |
|
| 2240 | + * |
|
| 2241 | + * @since 1.5.6 |
|
| 2242 | + * @package GeoDirectory |
|
| 2243 | + * |
|
| 2244 | + * @param string $gd_chunksize_options Entries options. |
|
| 2245 | + */ |
|
| 2246 | + $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options ); |
|
| 2247 | 2247 | |
| 2248 | 2248 | $gd_chunksize_option = ''; |
| 2249 | 2249 | foreach ($gd_chunksize_options as $value => $title) {
|
@@ -2259,12 +2259,12 @@ discard block |
||
| 2259 | 2259 | <div class="gd-content-heading"> |
| 2260 | 2260 | |
| 2261 | 2261 | <?php |
| 2262 | - ini_set('max_execution_time', 999999);
|
|
| 2263 | - $ini_max_execution_time_check = @ini_get( 'max_execution_time' ); |
|
| 2264 | - ini_restore('max_execution_time');
|
|
| 2262 | + ini_set('max_execution_time', 999999);
|
|
| 2263 | + $ini_max_execution_time_check = @ini_get( 'max_execution_time' ); |
|
| 2264 | + ini_restore('max_execution_time');
|
|
| 2265 | 2265 | |
| 2266 | - if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting
|
|
| 2267 | - ?> |
|
| 2266 | + if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting
|
|
| 2267 | + ?> |
|
| 2268 | 2268 | <div id="gd_ie_reqs" class="metabox-holder"> |
| 2269 | 2269 | <div class="meta-box-sortables ui-sortable"> |
| 2270 | 2270 | <div class="postbox"> |
@@ -2437,7 +2437,7 @@ discard block |
||
| 2437 | 2437 | * Called just after the sample CSV download link. |
| 2438 | 2438 | * |
| 2439 | 2439 | * @since 1.0.0 |
| 2440 | - * @package GeoDirectory |
|
| 2440 | + * @package GeoDirectory |
|
| 2441 | 2441 | */ |
| 2442 | 2442 | do_action('geodir_sample_cats_csv_download_link');
|
| 2443 | 2443 | ?> |
@@ -2522,11 +2522,11 @@ discard block |
||
| 2522 | 2522 | * |
| 2523 | 2523 | * Called after the last setting on the GD > Import & Export page. |
| 2524 | 2524 | * @since 1.4.6 |
| 2525 | - * @package GeoDirectory |
|
| 2525 | + * @package GeoDirectory |
|
| 2526 | 2526 | * |
| 2527 | 2527 | * @param array $gd_posttypes GD post types. |
| 2528 | - * @param array $gd_chunksize_options File chunk size options. |
|
| 2529 | - * @param string $nonce Wordpress security token for GD import & export. |
|
| 2528 | + * @param array $gd_chunksize_options File chunk size options. |
|
| 2529 | + * @param string $nonce Wordpress security token for GD import & export. |
|
| 2530 | 2530 | */ |
| 2531 | 2531 | do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce ); |
| 2532 | 2532 | ?> |
@@ -3213,44 +3213,44 @@ discard block |
||
| 3213 | 3213 | function geodir_init_filesystem() |
| 3214 | 3214 | {
|
| 3215 | 3215 | |
| 3216 | - if(!function_exists('get_filesystem_method')){
|
|
| 3217 | - require_once(ABSPATH."/wp-admin/includes/file.php"); |
|
| 3218 | - } |
|
| 3219 | - $access_type = get_filesystem_method(); |
|
| 3220 | - if ($access_type === 'direct') {
|
|
| 3221 | - /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */ |
|
| 3222 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
| 3223 | - |
|
| 3224 | - /* initialize the API */ |
|
| 3225 | - if (!WP_Filesystem($creds)) {
|
|
| 3226 | - /* any problems and we exit */ |
|
| 3227 | - //return '@@@3'; |
|
| 3228 | - return false; |
|
| 3229 | - } |
|
| 3216 | + if(!function_exists('get_filesystem_method')){
|
|
| 3217 | + require_once(ABSPATH."/wp-admin/includes/file.php"); |
|
| 3218 | + } |
|
| 3219 | + $access_type = get_filesystem_method(); |
|
| 3220 | + if ($access_type === 'direct') {
|
|
| 3221 | + /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */ |
|
| 3222 | + $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
| 3223 | + |
|
| 3224 | + /* initialize the API */ |
|
| 3225 | + if (!WP_Filesystem($creds)) {
|
|
| 3226 | + /* any problems and we exit */ |
|
| 3227 | + //return '@@@3'; |
|
| 3228 | + return false; |
|
| 3229 | + } |
|
| 3230 | 3230 | |
| 3231 | - global $wp_filesystem; |
|
| 3232 | - return $wp_filesystem; |
|
| 3233 | - /* do our file manipulations below */ |
|
| 3234 | - } elseif (defined('FTP_USER')) {
|
|
| 3235 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
| 3231 | + global $wp_filesystem; |
|
| 3232 | + return $wp_filesystem; |
|
| 3233 | + /* do our file manipulations below */ |
|
| 3234 | + } elseif (defined('FTP_USER')) {
|
|
| 3235 | + $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
| 3236 | + |
|
| 3237 | + /* initialize the API */ |
|
| 3238 | + if (!WP_Filesystem($creds)) {
|
|
| 3239 | + /* any problems and we exit */ |
|
| 3240 | + //return '@@@33'; |
|
| 3241 | + return false; |
|
| 3242 | + } |
|
| 3236 | 3243 | |
| 3237 | - /* initialize the API */ |
|
| 3238 | - if (!WP_Filesystem($creds)) {
|
|
| 3239 | - /* any problems and we exit */ |
|
| 3240 | - //return '@@@33'; |
|
| 3241 | - return false; |
|
| 3242 | - } |
|
| 3244 | + global $wp_filesystem; |
|
| 3245 | + //return '@@@1'; |
|
| 3246 | + return $wp_filesystem; |
|
| 3243 | 3247 | |
| 3244 | - global $wp_filesystem; |
|
| 3245 | - //return '@@@1'; |
|
| 3246 | - return $wp_filesystem; |
|
| 3247 | - |
|
| 3248 | - } else {
|
|
| 3249 | - //return '@@@2'; |
|
| 3250 | - /* don't have direct write access. Prompt user with our notice */ |
|
| 3251 | - add_action('admin_notice', 'geodir_filesystem_notice');
|
|
| 3252 | - return false; |
|
| 3253 | - } |
|
| 3248 | + } else {
|
|
| 3249 | + //return '@@@2'; |
|
| 3250 | + /* don't have direct write access. Prompt user with our notice */ |
|
| 3251 | + add_action('admin_notice', 'geodir_filesystem_notice');
|
|
| 3252 | + return false; |
|
| 3253 | + } |
|
| 3254 | 3254 | |
| 3255 | 3255 | } |
| 3256 | 3256 | |
@@ -3268,10 +3268,10 @@ discard block |
||
| 3268 | 3268 | */ |
| 3269 | 3269 | function geodir_filesystem_notice() |
| 3270 | 3270 | { if ( defined( 'DOING_AJAX' ) ){return;}
|
| 3271 | - $access_type = get_filesystem_method(); |
|
| 3272 | - if ($access_type === 'direct') {
|
|
| 3273 | - } elseif (!defined('FTP_USER')) {
|
|
| 3274 | - ?> |
|
| 3271 | + $access_type = get_filesystem_method(); |
|
| 3272 | + if ($access_type === 'direct') {
|
|
| 3273 | + } elseif (!defined('FTP_USER')) {
|
|
| 3274 | + ?> |
|
| 3275 | 3275 | <div class="error"> |
| 3276 | 3276 | <p><?php _e('GeoDirectory does not have access to your filesystem, thing like import/export will not work. Please define your details in wp-config.php as explained here', 'geodirectory'); ?>
|
| 3277 | 3277 | <a target="_blank" href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants">http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants</a> |
@@ -3297,1251 +3297,1251 @@ discard block |
||
| 3297 | 3297 | * @return string Json data. |
| 3298 | 3298 | */ |
| 3299 | 3299 | function geodir_ajax_import_export() {
|
| 3300 | - global $wpdb, $plugin_prefix, $current_user, $wp_filesystem; |
|
| 3300 | + global $wpdb, $plugin_prefix, $current_user, $wp_filesystem; |
|
| 3301 | 3301 | |
| 3302 | - error_reporting(0); |
|
| 3302 | + error_reporting(0); |
|
| 3303 | 3303 | |
| 3304 | - // try to set higher limits for import |
|
| 3305 | - $max_input_time = ini_get('max_input_time');
|
|
| 3306 | - $max_execution_time = ini_get('max_execution_time');
|
|
| 3307 | - $memory_limit= ini_get('memory_limit');
|
|
| 3304 | + // try to set higher limits for import |
|
| 3305 | + $max_input_time = ini_get('max_input_time');
|
|
| 3306 | + $max_execution_time = ini_get('max_execution_time');
|
|
| 3307 | + $memory_limit= ini_get('memory_limit');
|
|
| 3308 | 3308 | |
| 3309 | - if(!$max_input_time || $max_input_time<3000){
|
|
| 3310 | - ini_set('max_input_time', 3000);
|
|
| 3311 | - } |
|
| 3309 | + if(!$max_input_time || $max_input_time<3000){
|
|
| 3310 | + ini_set('max_input_time', 3000);
|
|
| 3311 | + } |
|
| 3312 | 3312 | |
| 3313 | - if(!$max_execution_time || $max_execution_time<3000){
|
|
| 3314 | - ini_set('max_execution_time', 3000);
|
|
| 3315 | - } |
|
| 3313 | + if(!$max_execution_time || $max_execution_time<3000){
|
|
| 3314 | + ini_set('max_execution_time', 3000);
|
|
| 3315 | + } |
|
| 3316 | 3316 | |
| 3317 | - if($memory_limit && str_replace('M','',$memory_limit)){
|
|
| 3318 | - if(str_replace('M','',$memory_limit)<256){
|
|
| 3319 | - ini_set('memory_limit', '256M');
|
|
| 3320 | - } |
|
| 3321 | - } |
|
| 3317 | + if($memory_limit && str_replace('M','',$memory_limit)){
|
|
| 3318 | + if(str_replace('M','',$memory_limit)<256){
|
|
| 3319 | + ini_set('memory_limit', '256M');
|
|
| 3320 | + } |
|
| 3321 | + } |
|
| 3322 | 3322 | |
| 3323 | - $json = array(); |
|
| 3323 | + $json = array(); |
|
| 3324 | 3324 | |
| 3325 | - if ( !current_user_can( 'manage_options' ) ) {
|
|
| 3326 | - wp_send_json( $json ); |
|
| 3327 | - } |
|
| 3325 | + if ( !current_user_can( 'manage_options' ) ) {
|
|
| 3326 | + wp_send_json( $json ); |
|
| 3327 | + } |
|
| 3328 | 3328 | |
| 3329 | - $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL; |
|
| 3330 | - $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL; |
|
| 3331 | - $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false; |
|
| 3329 | + $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL; |
|
| 3330 | + $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL; |
|
| 3331 | + $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false; |
|
| 3332 | 3332 | |
| 3333 | - if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) {
|
|
| 3334 | - wp_send_json( $json ); |
|
| 3335 | - } |
|
| 3333 | + if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) {
|
|
| 3334 | + wp_send_json( $json ); |
|
| 3335 | + } |
|
| 3336 | 3336 | |
| 3337 | - $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL; |
|
| 3338 | - $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL; |
|
| 3339 | - $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page; |
|
| 3340 | - $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1; |
|
| 3337 | + $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL; |
|
| 3338 | + $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL; |
|
| 3339 | + $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page; |
|
| 3340 | + $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1; |
|
| 3341 | 3341 | |
| 3342 | - $wp_filesystem = geodir_init_filesystem(); |
|
| 3343 | - if (!$wp_filesystem) {
|
|
| 3344 | - $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' ); |
|
| 3345 | - wp_send_json( $json ); |
|
| 3346 | - } |
|
| 3342 | + $wp_filesystem = geodir_init_filesystem(); |
|
| 3343 | + if (!$wp_filesystem) {
|
|
| 3344 | + $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' ); |
|
| 3345 | + wp_send_json( $json ); |
|
| 3346 | + } |
|
| 3347 | 3347 | |
| 3348 | - if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
|
|
| 3349 | - $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' ); |
|
| 3350 | - wp_send_json( $json ); |
|
| 3351 | - } |
|
| 3348 | + if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
|
|
| 3349 | + $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' ); |
|
| 3350 | + wp_send_json( $json ); |
|
| 3351 | + } |
|
| 3352 | 3352 | |
| 3353 | - $csv_file_dir = geodir_path_import_export( false ); |
|
| 3354 | - if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) {
|
|
| 3355 | - if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) {
|
|
| 3356 | - $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3357 | - wp_send_json( $json ); |
|
| 3358 | - } |
|
| 3359 | - } |
|
| 3353 | + $csv_file_dir = geodir_path_import_export( false ); |
|
| 3354 | + if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) {
|
|
| 3355 | + if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) {
|
|
| 3356 | + $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3357 | + wp_send_json( $json ); |
|
| 3358 | + } |
|
| 3359 | + } |
|
| 3360 | 3360 | |
| 3361 | - $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
|
|
| 3362 | - $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
|
|
| 3363 | - |
|
| 3364 | - switch ( $task ) {
|
|
| 3365 | - case 'export_posts': {
|
|
| 3366 | - // WPML |
|
| 3367 | - $is_wpml = geodir_is_wpml(); |
|
| 3368 | - if ($is_wpml) {
|
|
| 3369 | - global $sitepress; |
|
| 3370 | - $active_lang = ICL_LANGUAGE_CODE; |
|
| 3361 | + $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
|
|
| 3362 | + $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
|
|
| 3363 | + |
|
| 3364 | + switch ( $task ) {
|
|
| 3365 | + case 'export_posts': {
|
|
| 3366 | + // WPML |
|
| 3367 | + $is_wpml = geodir_is_wpml(); |
|
| 3368 | + if ($is_wpml) {
|
|
| 3369 | + global $sitepress; |
|
| 3370 | + $active_lang = ICL_LANGUAGE_CODE; |
|
| 3371 | 3371 | |
| 3372 | - $sitepress->switch_lang('all', true);
|
|
| 3373 | - } |
|
| 3374 | - // WPML |
|
| 3375 | - if ( $post_type == 'gd_event' ) {
|
|
| 3376 | - add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 ); |
|
| 3377 | - } |
|
| 3378 | - $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
| 3372 | + $sitepress->switch_lang('all', true);
|
|
| 3373 | + } |
|
| 3374 | + // WPML |
|
| 3375 | + if ( $post_type == 'gd_event' ) {
|
|
| 3376 | + add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 ); |
|
| 3377 | + } |
|
| 3378 | + $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
| 3379 | 3379 | |
| 3380 | - $file_name = $post_type . '_' . date( 'dmyHi' ); |
|
| 3381 | - if ( $filters && isset( $filters['start_date'] ) && isset( $filters['end_date'] ) ) {
|
|
| 3382 | - $file_name = $post_type . '_' . date_i18n( 'dmy', strtotime( $filters['start_date'] ) ) . '_' . date_i18n( 'dmy', strtotime( $filters['end_date'] ) ); |
|
| 3383 | - } |
|
| 3384 | - $posts_count = geodir_get_posts_count( $post_type ); |
|
| 3385 | - $file_url_base = geodir_path_import_export() . '/'; |
|
| 3386 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3387 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3388 | - $file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv'; |
|
| 3380 | + $file_name = $post_type . '_' . date( 'dmyHi' ); |
|
| 3381 | + if ( $filters && isset( $filters['start_date'] ) && isset( $filters['end_date'] ) ) {
|
|
| 3382 | + $file_name = $post_type . '_' . date_i18n( 'dmy', strtotime( $filters['start_date'] ) ) . '_' . date_i18n( 'dmy', strtotime( $filters['end_date'] ) ); |
|
| 3383 | + } |
|
| 3384 | + $posts_count = geodir_get_posts_count( $post_type ); |
|
| 3385 | + $file_url_base = geodir_path_import_export() . '/'; |
|
| 3386 | + $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3387 | + $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3388 | + $file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv'; |
|
| 3389 | 3389 | |
| 3390 | - $chunk_file_paths = array(); |
|
| 3390 | + $chunk_file_paths = array(); |
|
| 3391 | 3391 | |
| 3392 | - if ( isset( $_REQUEST['_c'] ) ) {
|
|
| 3393 | - $json['total'] = $posts_count; |
|
| 3394 | - // WPML |
|
| 3395 | - if ($is_wpml) {
|
|
| 3396 | - $sitepress->switch_lang($active_lang, true); |
|
| 3397 | - } |
|
| 3398 | - // WPML |
|
| 3399 | - wp_send_json( $json ); |
|
| 3400 | - gd_die(); |
|
| 3401 | - } else if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3402 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3403 | - $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0; |
|
| 3404 | - $percentage = min( $percentage, 100 ); |
|
| 3392 | + if ( isset( $_REQUEST['_c'] ) ) {
|
|
| 3393 | + $json['total'] = $posts_count; |
|
| 3394 | + // WPML |
|
| 3395 | + if ($is_wpml) {
|
|
| 3396 | + $sitepress->switch_lang($active_lang, true); |
|
| 3397 | + } |
|
| 3398 | + // WPML |
|
| 3399 | + wp_send_json( $json ); |
|
| 3400 | + gd_die(); |
|
| 3401 | + } else if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3402 | + $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3403 | + $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0; |
|
| 3404 | + $percentage = min( $percentage, 100 ); |
|
| 3405 | 3405 | |
| 3406 | - $json['percentage'] = $percentage; |
|
| 3407 | - // WPML |
|
| 3408 | - if ($is_wpml) {
|
|
| 3409 | - $sitepress->switch_lang($active_lang, true); |
|
| 3410 | - } |
|
| 3411 | - // WPML |
|
| 3412 | - wp_send_json( $json ); |
|
| 3413 | - gd_die(); |
|
| 3414 | - } else {
|
|
| 3415 | - if ( !$posts_count > 0 ) {
|
|
| 3416 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3417 | - } else {
|
|
| 3418 | - $total_posts = $posts_count; |
|
| 3419 | - if ($chunk_per_page > $total_posts) {
|
|
| 3420 | - $chunk_per_page = $total_posts; |
|
| 3421 | - } |
|
| 3422 | - $chunk_total_pages = ceil( $total_posts / $chunk_per_page ); |
|
| 3406 | + $json['percentage'] = $percentage; |
|
| 3407 | + // WPML |
|
| 3408 | + if ($is_wpml) {
|
|
| 3409 | + $sitepress->switch_lang($active_lang, true); |
|
| 3410 | + } |
|
| 3411 | + // WPML |
|
| 3412 | + wp_send_json( $json ); |
|
| 3413 | + gd_die(); |
|
| 3414 | + } else {
|
|
| 3415 | + if ( !$posts_count > 0 ) {
|
|
| 3416 | + $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3417 | + } else {
|
|
| 3418 | + $total_posts = $posts_count; |
|
| 3419 | + if ($chunk_per_page > $total_posts) {
|
|
| 3420 | + $chunk_per_page = $total_posts; |
|
| 3421 | + } |
|
| 3422 | + $chunk_total_pages = ceil( $total_posts / $chunk_per_page ); |
|
| 3423 | 3423 | |
| 3424 | - $j = $chunk_page_no; |
|
| 3425 | - $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j ); |
|
| 3424 | + $j = $chunk_page_no; |
|
| 3425 | + $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j ); |
|
| 3426 | 3426 | |
| 3427 | - $per_page = 500; |
|
| 3428 | - if ($per_page > $chunk_per_page) {
|
|
| 3429 | - $per_page = $chunk_per_page; |
|
| 3430 | - } |
|
| 3431 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3427 | + $per_page = 500; |
|
| 3428 | + if ($per_page > $chunk_per_page) {
|
|
| 3429 | + $per_page = $chunk_per_page; |
|
| 3430 | + } |
|
| 3431 | + $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3432 | 3432 | |
| 3433 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3434 | - $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page ); |
|
| 3433 | + for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3434 | + $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page ); |
|
| 3435 | 3435 | |
| 3436 | - $clear = $i == 0 ? true : false; |
|
| 3437 | - geodir_save_csv_data( $file_path_temp, $save_posts, $clear ); |
|
| 3438 | - } |
|
| 3436 | + $clear = $i == 0 ? true : false; |
|
| 3437 | + geodir_save_csv_data( $file_path_temp, $save_posts, $clear ); |
|
| 3438 | + } |
|
| 3439 | 3439 | |
| 3440 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3441 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3442 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3443 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3444 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3440 | + if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3441 | + $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3442 | + $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3443 | + $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3444 | + $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3445 | 3445 | |
| 3446 | - $file_url = $file_url_base . $chunk_file_name; |
|
| 3447 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3448 | - } |
|
| 3446 | + $file_url = $file_url_base . $chunk_file_name; |
|
| 3447 | + $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3448 | + } |
|
| 3449 | 3449 | |
| 3450 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3451 | - $json['total'] = $posts_count; |
|
| 3452 | - $json['files'] = $chunk_file_paths; |
|
| 3453 | - } else {
|
|
| 3454 | - if ($j > 1) {
|
|
| 3455 | - $json['total'] = $posts_count; |
|
| 3456 | - $json['files'] = array(); |
|
| 3457 | - } else {
|
|
| 3458 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3459 | - } |
|
| 3460 | - } |
|
| 3461 | - } |
|
| 3462 | - // WPML |
|
| 3463 | - if ($is_wpml) {
|
|
| 3464 | - $sitepress->switch_lang($active_lang, true); |
|
| 3465 | - } |
|
| 3466 | - // WPML |
|
| 3467 | - wp_send_json( $json ); |
|
| 3468 | - } |
|
| 3469 | - } |
|
| 3470 | - break; |
|
| 3471 | - case 'export_cats': {
|
|
| 3472 | - // WPML |
|
| 3473 | - $is_wpml = geodir_is_wpml(); |
|
| 3474 | - if ($is_wpml) {
|
|
| 3475 | - global $sitepress; |
|
| 3476 | - $active_lang = ICL_LANGUAGE_CODE; |
|
| 3450 | + if ( !empty($chunk_file_paths) ) {
|
|
| 3451 | + $json['total'] = $posts_count; |
|
| 3452 | + $json['files'] = $chunk_file_paths; |
|
| 3453 | + } else {
|
|
| 3454 | + if ($j > 1) {
|
|
| 3455 | + $json['total'] = $posts_count; |
|
| 3456 | + $json['files'] = array(); |
|
| 3457 | + } else {
|
|
| 3458 | + $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3459 | + } |
|
| 3460 | + } |
|
| 3461 | + } |
|
| 3462 | + // WPML |
|
| 3463 | + if ($is_wpml) {
|
|
| 3464 | + $sitepress->switch_lang($active_lang, true); |
|
| 3465 | + } |
|
| 3466 | + // WPML |
|
| 3467 | + wp_send_json( $json ); |
|
| 3468 | + } |
|
| 3469 | + } |
|
| 3470 | + break; |
|
| 3471 | + case 'export_cats': {
|
|
| 3472 | + // WPML |
|
| 3473 | + $is_wpml = geodir_is_wpml(); |
|
| 3474 | + if ($is_wpml) {
|
|
| 3475 | + global $sitepress; |
|
| 3476 | + $active_lang = ICL_LANGUAGE_CODE; |
|
| 3477 | 3477 | |
| 3478 | - $sitepress->switch_lang('all', true);
|
|
| 3479 | - } |
|
| 3480 | - // WPML |
|
| 3481 | - $file_name = $post_type . 'category_' . date( 'dmyHi' ); |
|
| 3478 | + $sitepress->switch_lang('all', true);
|
|
| 3479 | + } |
|
| 3480 | + // WPML |
|
| 3481 | + $file_name = $post_type . 'category_' . date( 'dmyHi' ); |
|
| 3482 | 3482 | |
| 3483 | - $terms_count = geodir_get_terms_count( $post_type ); |
|
| 3484 | - $file_url_base = geodir_path_import_export() . '/'; |
|
| 3485 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3486 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3487 | - $file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv'; |
|
| 3483 | + $terms_count = geodir_get_terms_count( $post_type ); |
|
| 3484 | + $file_url_base = geodir_path_import_export() . '/'; |
|
| 3485 | + $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3486 | + $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3487 | + $file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv'; |
|
| 3488 | 3488 | |
| 3489 | - $chunk_file_paths = array(); |
|
| 3489 | + $chunk_file_paths = array(); |
|
| 3490 | 3490 | |
| 3491 | - if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3492 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3493 | - $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0; |
|
| 3494 | - $percentage = min( $percentage, 100 ); |
|
| 3491 | + if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3492 | + $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3493 | + $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0; |
|
| 3494 | + $percentage = min( $percentage, 100 ); |
|
| 3495 | 3495 | |
| 3496 | - $json['percentage'] = $percentage; |
|
| 3497 | - // WPML |
|
| 3498 | - if ($is_wpml) {
|
|
| 3499 | - $sitepress->switch_lang($active_lang, true); |
|
| 3500 | - } |
|
| 3501 | - // WPML |
|
| 3502 | - wp_send_json( $json ); |
|
| 3503 | - } else {
|
|
| 3504 | - if ( !$terms_count > 0 ) {
|
|
| 3505 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3506 | - } else {
|
|
| 3507 | - $total_terms = $terms_count; |
|
| 3508 | - if ($chunk_per_page > $terms_count) {
|
|
| 3509 | - $chunk_per_page = $terms_count; |
|
| 3510 | - } |
|
| 3511 | - $chunk_total_pages = ceil( $total_terms / $chunk_per_page ); |
|
| 3496 | + $json['percentage'] = $percentage; |
|
| 3497 | + // WPML |
|
| 3498 | + if ($is_wpml) {
|
|
| 3499 | + $sitepress->switch_lang($active_lang, true); |
|
| 3500 | + } |
|
| 3501 | + // WPML |
|
| 3502 | + wp_send_json( $json ); |
|
| 3503 | + } else {
|
|
| 3504 | + if ( !$terms_count > 0 ) {
|
|
| 3505 | + $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3506 | + } else {
|
|
| 3507 | + $total_terms = $terms_count; |
|
| 3508 | + if ($chunk_per_page > $terms_count) {
|
|
| 3509 | + $chunk_per_page = $terms_count; |
|
| 3510 | + } |
|
| 3511 | + $chunk_total_pages = ceil( $total_terms / $chunk_per_page ); |
|
| 3512 | 3512 | |
| 3513 | - $j = $chunk_page_no; |
|
| 3514 | - $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j ); |
|
| 3513 | + $j = $chunk_page_no; |
|
| 3514 | + $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j ); |
|
| 3515 | 3515 | |
| 3516 | - $per_page = 500; |
|
| 3517 | - if ($per_page > $chunk_per_page) {
|
|
| 3518 | - $per_page = $chunk_per_page; |
|
| 3519 | - } |
|
| 3520 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3516 | + $per_page = 500; |
|
| 3517 | + if ($per_page > $chunk_per_page) {
|
|
| 3518 | + $per_page = $chunk_per_page; |
|
| 3519 | + } |
|
| 3520 | + $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3521 | 3521 | |
| 3522 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3523 | - $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page ); |
|
| 3522 | + for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3523 | + $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page ); |
|
| 3524 | 3524 | |
| 3525 | - $clear = $i == 0 ? true : false; |
|
| 3526 | - geodir_save_csv_data( $file_path_temp, $save_terms, $clear ); |
|
| 3527 | - } |
|
| 3525 | + $clear = $i == 0 ? true : false; |
|
| 3526 | + geodir_save_csv_data( $file_path_temp, $save_terms, $clear ); |
|
| 3527 | + } |
|
| 3528 | 3528 | |
| 3529 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3530 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3531 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3532 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3533 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3529 | + if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3530 | + $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3531 | + $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3532 | + $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3533 | + $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3534 | 3534 | |
| 3535 | - $file_url = $file_url_base . $chunk_file_name; |
|
| 3536 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3537 | - } |
|
| 3535 | + $file_url = $file_url_base . $chunk_file_name; |
|
| 3536 | + $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3537 | + } |
|
| 3538 | 3538 | |
| 3539 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3540 | - $json['total'] = $terms_count; |
|
| 3541 | - $json['files'] = $chunk_file_paths; |
|
| 3542 | - } else {
|
|
| 3543 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3544 | - } |
|
| 3545 | - } |
|
| 3546 | - // WPML |
|
| 3547 | - if ($is_wpml) {
|
|
| 3548 | - $sitepress->switch_lang($active_lang, true); |
|
| 3549 | - } |
|
| 3550 | - // WPML |
|
| 3551 | - wp_send_json( $json ); |
|
| 3552 | - } |
|
| 3553 | - } |
|
| 3554 | - break; |
|
| 3555 | - case 'export_locations': {
|
|
| 3556 | - $file_url_base = geodir_path_import_export() . '/'; |
|
| 3557 | - $file_name = 'gd_locations_' . date( 'dmyHi' ); |
|
| 3558 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3559 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3560 | - $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv'; |
|
| 3539 | + if ( !empty($chunk_file_paths) ) {
|
|
| 3540 | + $json['total'] = $terms_count; |
|
| 3541 | + $json['files'] = $chunk_file_paths; |
|
| 3542 | + } else {
|
|
| 3543 | + $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3544 | + } |
|
| 3545 | + } |
|
| 3546 | + // WPML |
|
| 3547 | + if ($is_wpml) {
|
|
| 3548 | + $sitepress->switch_lang($active_lang, true); |
|
| 3549 | + } |
|
| 3550 | + // WPML |
|
| 3551 | + wp_send_json( $json ); |
|
| 3552 | + } |
|
| 3553 | + } |
|
| 3554 | + break; |
|
| 3555 | + case 'export_locations': {
|
|
| 3556 | + $file_url_base = geodir_path_import_export() . '/'; |
|
| 3557 | + $file_name = 'gd_locations_' . date( 'dmyHi' ); |
|
| 3558 | + $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3559 | + $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3560 | + $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv'; |
|
| 3561 | 3561 | |
| 3562 | - $items_count = (int)geodir_location_imex_count_locations(); |
|
| 3562 | + $items_count = (int)geodir_location_imex_count_locations(); |
|
| 3563 | 3563 | |
| 3564 | - if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3565 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3566 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
| 3567 | - $percentage = min( $percentage, 100 ); |
|
| 3564 | + if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3565 | + $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3566 | + $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
| 3567 | + $percentage = min( $percentage, 100 ); |
|
| 3568 | 3568 | |
| 3569 | - $json['percentage'] = $percentage; |
|
| 3570 | - wp_send_json( $json ); |
|
| 3571 | - } else {
|
|
| 3572 | - $chunk_file_paths = array(); |
|
| 3569 | + $json['percentage'] = $percentage; |
|
| 3570 | + wp_send_json( $json ); |
|
| 3571 | + } else {
|
|
| 3572 | + $chunk_file_paths = array(); |
|
| 3573 | 3573 | |
| 3574 | - if ( !$items_count > 0 ) {
|
|
| 3575 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3576 | - } else {
|
|
| 3577 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 3578 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 3574 | + if ( !$items_count > 0 ) {
|
|
| 3575 | + $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3576 | + } else {
|
|
| 3577 | + $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 3578 | + $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 3579 | 3579 | |
| 3580 | - $j = $chunk_page_no; |
|
| 3581 | - $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j ); |
|
| 3580 | + $j = $chunk_page_no; |
|
| 3581 | + $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j ); |
|
| 3582 | 3582 | |
| 3583 | - $per_page = 500; |
|
| 3584 | - $per_page = min( $per_page, $chunk_per_page ); |
|
| 3585 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3583 | + $per_page = 500; |
|
| 3584 | + $per_page = min( $per_page, $chunk_per_page ); |
|
| 3585 | + $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3586 | 3586 | |
| 3587 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3588 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
| 3587 | + for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3588 | + $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
| 3589 | 3589 | |
| 3590 | - $clear = $i == 0 ? true : false; |
|
| 3591 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 3592 | - } |
|
| 3590 | + $clear = $i == 0 ? true : false; |
|
| 3591 | + geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 3592 | + } |
|
| 3593 | 3593 | |
| 3594 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3595 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3596 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3597 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3598 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3594 | + if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3595 | + $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3596 | + $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3597 | + $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3598 | + $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3599 | 3599 | |
| 3600 | - $file_url = $file_url_base . $chunk_file_name; |
|
| 3601 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3602 | - } |
|
| 3600 | + $file_url = $file_url_base . $chunk_file_name; |
|
| 3601 | + $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3602 | + } |
|
| 3603 | 3603 | |
| 3604 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3605 | - $json['total'] = $items_count; |
|
| 3606 | - $json['files'] = $chunk_file_paths; |
|
| 3607 | - } else {
|
|
| 3608 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 3609 | - } |
|
| 3610 | - } |
|
| 3611 | - wp_send_json( $json ); |
|
| 3612 | - } |
|
| 3613 | - } |
|
| 3614 | - break; |
|
| 3615 | - case 'export_hoods': {
|
|
| 3616 | - $file_url_base = geodir_path_import_export() . '/'; |
|
| 3617 | - $file_name = 'gd_neighbourhoods_' . date( 'dmyHi' ); |
|
| 3618 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3619 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3620 | - $file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv'; |
|
| 3604 | + if ( !empty($chunk_file_paths) ) {
|
|
| 3605 | + $json['total'] = $items_count; |
|
| 3606 | + $json['files'] = $chunk_file_paths; |
|
| 3607 | + } else {
|
|
| 3608 | + $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 3609 | + } |
|
| 3610 | + } |
|
| 3611 | + wp_send_json( $json ); |
|
| 3612 | + } |
|
| 3613 | + } |
|
| 3614 | + break; |
|
| 3615 | + case 'export_hoods': {
|
|
| 3616 | + $file_url_base = geodir_path_import_export() . '/'; |
|
| 3617 | + $file_name = 'gd_neighbourhoods_' . date( 'dmyHi' ); |
|
| 3618 | + $file_url = $file_url_base . $file_name . '.csv'; |
|
| 3619 | + $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
| 3620 | + $file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv'; |
|
| 3621 | 3621 | |
| 3622 | - $items_count = (int)geodir_location_imex_count_neighbourhoods(); |
|
| 3622 | + $items_count = (int)geodir_location_imex_count_neighbourhoods(); |
|
| 3623 | 3623 | |
| 3624 | - if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3625 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3626 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
| 3627 | - $percentage = min( $percentage, 100 ); |
|
| 3624 | + if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 3625 | + $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 3626 | + $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
| 3627 | + $percentage = min( $percentage, 100 ); |
|
| 3628 | 3628 | |
| 3629 | - $json['percentage'] = $percentage; |
|
| 3630 | - wp_send_json( $json ); |
|
| 3631 | - } else {
|
|
| 3632 | - $chunk_file_paths = array(); |
|
| 3629 | + $json['percentage'] = $percentage; |
|
| 3630 | + wp_send_json( $json ); |
|
| 3631 | + } else {
|
|
| 3632 | + $chunk_file_paths = array(); |
|
| 3633 | 3633 | |
| 3634 | - if ( !$items_count > 0 ) {
|
|
| 3635 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3636 | - } else {
|
|
| 3637 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 3638 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 3634 | + if ( !$items_count > 0 ) {
|
|
| 3635 | + $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3636 | + } else {
|
|
| 3637 | + $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 3638 | + $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 3639 | 3639 | |
| 3640 | - $j = $chunk_page_no; |
|
| 3641 | - $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j ); |
|
| 3640 | + $j = $chunk_page_no; |
|
| 3641 | + $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j ); |
|
| 3642 | 3642 | |
| 3643 | - $per_page = 500; |
|
| 3644 | - $per_page = min( $per_page, $chunk_per_page ); |
|
| 3645 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3643 | + $per_page = 500; |
|
| 3644 | + $per_page = min( $per_page, $chunk_per_page ); |
|
| 3645 | + $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 3646 | 3646 | |
| 3647 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3648 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
| 3647 | + for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 3648 | + $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
| 3649 | 3649 | |
| 3650 | - $clear = $i == 0 ? true : false; |
|
| 3651 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 3652 | - } |
|
| 3650 | + $clear = $i == 0 ? true : false; |
|
| 3651 | + geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 3652 | + } |
|
| 3653 | 3653 | |
| 3654 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3655 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3656 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3657 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3658 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3654 | + if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 3655 | + $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
| 3656 | + $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
| 3657 | + $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
| 3658 | + $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 3659 | 3659 | |
| 3660 | - $file_url = $file_url_base . $chunk_file_name; |
|
| 3661 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3662 | - } |
|
| 3660 | + $file_url = $file_url_base . $chunk_file_name; |
|
| 3661 | + $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
|
| 3662 | + } |
|
| 3663 | 3663 | |
| 3664 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3665 | - $json['total'] = $items_count; |
|
| 3666 | - $json['files'] = $chunk_file_paths; |
|
| 3667 | - } else {
|
|
| 3668 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 3669 | - } |
|
| 3670 | - } |
|
| 3671 | - wp_send_json( $json ); |
|
| 3672 | - } |
|
| 3673 | - } |
|
| 3674 | - break; |
|
| 3675 | - case 'prepare_import': |
|
| 3676 | - case 'import_cat': |
|
| 3677 | - case 'import_post': |
|
| 3678 | - case 'import_loc': |
|
| 3679 | - case 'import_hood': {
|
|
| 3680 | - // WPML |
|
| 3681 | - $is_wpml = geodir_is_wpml(); |
|
| 3682 | - if ($is_wpml) {
|
|
| 3683 | - global $sitepress; |
|
| 3684 | - $active_lang = ICL_LANGUAGE_CODE; |
|
| 3685 | - } |
|
| 3686 | - // WPML |
|
| 3664 | + if ( !empty($chunk_file_paths) ) {
|
|
| 3665 | + $json['total'] = $items_count; |
|
| 3666 | + $json['files'] = $chunk_file_paths; |
|
| 3667 | + } else {
|
|
| 3668 | + $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 3669 | + } |
|
| 3670 | + } |
|
| 3671 | + wp_send_json( $json ); |
|
| 3672 | + } |
|
| 3673 | + } |
|
| 3674 | + break; |
|
| 3675 | + case 'prepare_import': |
|
| 3676 | + case 'import_cat': |
|
| 3677 | + case 'import_post': |
|
| 3678 | + case 'import_loc': |
|
| 3679 | + case 'import_hood': {
|
|
| 3680 | + // WPML |
|
| 3681 | + $is_wpml = geodir_is_wpml(); |
|
| 3682 | + if ($is_wpml) {
|
|
| 3683 | + global $sitepress; |
|
| 3684 | + $active_lang = ICL_LANGUAGE_CODE; |
|
| 3685 | + } |
|
| 3686 | + // WPML |
|
| 3687 | 3687 | |
| 3688 | - ini_set( 'auto_detect_line_endings', true ); |
|
| 3688 | + ini_set( 'auto_detect_line_endings', true ); |
|
| 3689 | 3689 | |
| 3690 | - $uploads = wp_upload_dir(); |
|
| 3691 | - $uploads_dir = $uploads['path']; |
|
| 3692 | - $uploads_subdir = $uploads['subdir']; |
|
| 3690 | + $uploads = wp_upload_dir(); |
|
| 3691 | + $uploads_dir = $uploads['path']; |
|
| 3692 | + $uploads_subdir = $uploads['subdir']; |
|
| 3693 | 3693 | |
| 3694 | - $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL; |
|
| 3695 | - $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip'; |
|
| 3694 | + $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL; |
|
| 3695 | + $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip'; |
|
| 3696 | 3696 | |
| 3697 | - $csv_file_arr = explode( '/', $csv_file ); |
|
| 3698 | - $csv_filename = end( $csv_file_arr ); |
|
| 3699 | - $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename; |
|
| 3697 | + $csv_file_arr = explode( '/', $csv_file ); |
|
| 3698 | + $csv_filename = end( $csv_file_arr ); |
|
| 3699 | + $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename; |
|
| 3700 | 3700 | |
| 3701 | - $json['file'] = $csv_file; |
|
| 3702 | - $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' ); |
|
| 3703 | - $file = array(); |
|
| 3701 | + $json['file'] = $csv_file; |
|
| 3702 | + $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' ); |
|
| 3703 | + $file = array(); |
|
| 3704 | 3704 | |
| 3705 | - if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) {
|
|
| 3706 | - $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename ); |
|
| 3705 | + if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) {
|
|
| 3706 | + $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename ); |
|
| 3707 | 3707 | |
| 3708 | - if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
|
|
| 3709 | - $json['error'] = NULL; |
|
| 3710 | - $json['rows'] = 0; |
|
| 3708 | + if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
|
|
| 3709 | + $json['error'] = NULL; |
|
| 3710 | + $json['rows'] = 0; |
|
| 3711 | 3711 | |
| 3712 | - $lc_all = setlocale(LC_ALL, 0); // Fix issue of fgetcsv ignores special characters when they are at the beginning of line |
|
| 3713 | - setlocale(LC_ALL, 'en_US.UTF-8'); |
|
| 3714 | - if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) {
|
|
| 3715 | - while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) {
|
|
| 3716 | - if ( !empty( $data ) ) {
|
|
| 3717 | - $file[] = $data; |
|
| 3718 | - } |
|
| 3719 | - } |
|
| 3720 | - fclose($handle); |
|
| 3721 | - } |
|
| 3722 | - setlocale(LC_ALL, $lc_all); |
|
| 3712 | + $lc_all = setlocale(LC_ALL, 0); // Fix issue of fgetcsv ignores special characters when they are at the beginning of line |
|
| 3713 | + setlocale(LC_ALL, 'en_US.UTF-8'); |
|
| 3714 | + if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) {
|
|
| 3715 | + while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) {
|
|
| 3716 | + if ( !empty( $data ) ) {
|
|
| 3717 | + $file[] = $data; |
|
| 3718 | + } |
|
| 3719 | + } |
|
| 3720 | + fclose($handle); |
|
| 3721 | + } |
|
| 3722 | + setlocale(LC_ALL, $lc_all); |
|
| 3723 | 3723 | |
| 3724 | - $json['rows'] = (!empty($file) && count($file) > 1) ? count($file) - 1 : 0; |
|
| 3724 | + $json['rows'] = (!empty($file) && count($file) > 1) ? count($file) - 1 : 0; |
|
| 3725 | 3725 | |
| 3726 | - if (!$json['rows'] > 0) {
|
|
| 3727 | - $json['error'] = __('No data found in csv file.', 'geodirectory');
|
|
| 3728 | - } |
|
| 3729 | - } else {
|
|
| 3730 | - wp_send_json( $json ); |
|
| 3731 | - } |
|
| 3732 | - } else {
|
|
| 3733 | - wp_send_json( $json ); |
|
| 3734 | - } |
|
| 3726 | + if (!$json['rows'] > 0) {
|
|
| 3727 | + $json['error'] = __('No data found in csv file.', 'geodirectory');
|
|
| 3728 | + } |
|
| 3729 | + } else {
|
|
| 3730 | + wp_send_json( $json ); |
|
| 3731 | + } |
|
| 3732 | + } else {
|
|
| 3733 | + wp_send_json( $json ); |
|
| 3734 | + } |
|
| 3735 | 3735 | |
| 3736 | - if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
|
|
| 3737 | - wp_send_json( $json ); |
|
| 3738 | - } |
|
| 3736 | + if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
|
|
| 3737 | + wp_send_json( $json ); |
|
| 3738 | + } |
|
| 3739 | 3739 | |
| 3740 | - $total = $json['rows']; |
|
| 3741 | - $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1; |
|
| 3742 | - $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0; |
|
| 3740 | + $total = $json['rows']; |
|
| 3741 | + $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1; |
|
| 3742 | + $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0; |
|
| 3743 | 3743 | |
| 3744 | - $count = $limit; |
|
| 3744 | + $count = $limit; |
|
| 3745 | 3745 | |
| 3746 | - if ($count < $total) {
|
|
| 3747 | - $count = $processed + $count; |
|
| 3748 | - if ($count > $total) {
|
|
| 3749 | - $count = $total; |
|
| 3750 | - } |
|
| 3751 | - } else {
|
|
| 3752 | - $count = $total; |
|
| 3753 | - } |
|
| 3746 | + if ($count < $total) {
|
|
| 3747 | + $count = $processed + $count; |
|
| 3748 | + if ($count > $total) {
|
|
| 3749 | + $count = $total; |
|
| 3750 | + } |
|
| 3751 | + } else {
|
|
| 3752 | + $count = $total; |
|
| 3753 | + } |
|
| 3754 | 3754 | |
| 3755 | - $created = 0; |
|
| 3756 | - $updated = 0; |
|
| 3757 | - $skipped = 0; |
|
| 3758 | - $invalid = 0; |
|
| 3759 | - $invalid_addr = 0; |
|
| 3760 | - $images = 0; |
|
| 3755 | + $created = 0; |
|
| 3756 | + $updated = 0; |
|
| 3757 | + $skipped = 0; |
|
| 3758 | + $invalid = 0; |
|
| 3759 | + $invalid_addr = 0; |
|
| 3760 | + $images = 0; |
|
| 3761 | 3761 | |
| 3762 | - $gd_post_info = array(); |
|
| 3763 | - $countpost = 0; |
|
| 3762 | + $gd_post_info = array(); |
|
| 3763 | + $countpost = 0; |
|
| 3764 | 3764 | |
| 3765 | - $post_types = geodir_get_posttypes(); |
|
| 3765 | + $post_types = geodir_get_posttypes(); |
|
| 3766 | 3766 | |
| 3767 | - if ( $task == 'import_cat' ) {
|
|
| 3768 | - if (!empty($file)) {
|
|
| 3769 | - $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 3767 | + if ( $task == 'import_cat' ) {
|
|
| 3768 | + if (!empty($file)) {
|
|
| 3769 | + $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 3770 | 3770 | |
| 3771 | - if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 3772 | - $json['error'] = CSV_INVAILD_FILE; |
|
| 3773 | - wp_send_json( $json ); |
|
| 3774 | - exit; |
|
| 3775 | - } |
|
| 3771 | + if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 3772 | + $json['error'] = CSV_INVAILD_FILE; |
|
| 3773 | + wp_send_json( $json ); |
|
| 3774 | + exit; |
|
| 3775 | + } |
|
| 3776 | 3776 | |
| 3777 | - $gd_error_log = __('GD IMPORT CATEGORIES [ROW %d]:', 'geodirectory');
|
|
| 3777 | + $gd_error_log = __('GD IMPORT CATEGORIES [ROW %d]:', 'geodirectory');
|
|
| 3778 | 3778 | |
| 3779 | - for ($i = 1; $i <= $limit; $i++) {
|
|
| 3780 | - $index = $processed + $i; |
|
| 3779 | + for ($i = 1; $i <= $limit; $i++) {
|
|
| 3780 | + $index = $processed + $i; |
|
| 3781 | 3781 | |
| 3782 | - if (isset($file[$index])) {
|
|
| 3783 | - $row = $file[$index]; |
|
| 3784 | - $row = array_map( 'trim', $row ); |
|
| 3785 | - //$row = array_map( 'utf8_encode', $row ); |
|
| 3782 | + if (isset($file[$index])) {
|
|
| 3783 | + $row = $file[$index]; |
|
| 3784 | + $row = array_map( 'trim', $row ); |
|
| 3785 | + //$row = array_map( 'utf8_encode', $row ); |
|
| 3786 | 3786 | |
| 3787 | - $cat_id = ''; |
|
| 3788 | - $cat_name = ''; |
|
| 3789 | - $cat_slug = ''; |
|
| 3790 | - $cat_posttype = ''; |
|
| 3791 | - $cat_parent = ''; |
|
| 3792 | - $cat_description = ''; |
|
| 3793 | - $cat_schema = ''; |
|
| 3794 | - $cat_top_description = ''; |
|
| 3795 | - $cat_image = ''; |
|
| 3796 | - $cat_icon = ''; |
|
| 3797 | - $cat_language = ''; |
|
| 3798 | - $cat_id_original = ''; |
|
| 3787 | + $cat_id = ''; |
|
| 3788 | + $cat_name = ''; |
|
| 3789 | + $cat_slug = ''; |
|
| 3790 | + $cat_posttype = ''; |
|
| 3791 | + $cat_parent = ''; |
|
| 3792 | + $cat_description = ''; |
|
| 3793 | + $cat_schema = ''; |
|
| 3794 | + $cat_top_description = ''; |
|
| 3795 | + $cat_image = ''; |
|
| 3796 | + $cat_icon = ''; |
|
| 3797 | + $cat_language = ''; |
|
| 3798 | + $cat_id_original = ''; |
|
| 3799 | 3799 | |
| 3800 | - $c = 0; |
|
| 3801 | - foreach ($columns as $column ) {
|
|
| 3802 | - if ( $column == 'cat_id' ) {
|
|
| 3803 | - $cat_id = (int)$row[$c]; |
|
| 3804 | - } else if ( $column == 'cat_name' ) {
|
|
| 3805 | - $cat_name = $row[$c]; |
|
| 3806 | - } else if ( $column == 'cat_slug' ) {
|
|
| 3807 | - $cat_slug = $row[$c]; |
|
| 3808 | - } else if ( $column == 'cat_posttype' ) {
|
|
| 3809 | - $cat_posttype = $row[$c]; |
|
| 3810 | - } else if ( $column == 'cat_parent' ) {
|
|
| 3811 | - $cat_parent = trim($row[$c]); |
|
| 3812 | - } else if ( $column == 'cat_schema' && $row[$c] != '' ) {
|
|
| 3813 | - $cat_schema = $row[$c]; |
|
| 3814 | - } else if ( $column == 'cat_description' ) {
|
|
| 3815 | - $cat_description = $row[$c]; |
|
| 3816 | - } else if ( $column == 'cat_top_description' ) {
|
|
| 3817 | - $cat_top_description = $row[$c]; |
|
| 3818 | - } else if ( $column == 'cat_image' ) {
|
|
| 3819 | - $cat_image = $row[$c]; |
|
| 3820 | - } else if ( $column == 'cat_icon' ) {
|
|
| 3821 | - $cat_icon = $row[$c]; |
|
| 3822 | - } |
|
| 3823 | - // WPML |
|
| 3824 | - if ( $is_wpml ) {
|
|
| 3825 | - if ( $column == 'cat_language' ) {
|
|
| 3826 | - $cat_language = geodir_strtolower( trim( $row[$c] ) ); |
|
| 3827 | - } else if ( $column == 'cat_id_original' ) {
|
|
| 3828 | - $cat_id_original = (int)$row[$c]; |
|
| 3829 | - } |
|
| 3830 | - } |
|
| 3831 | - // WPML |
|
| 3832 | - $c++; |
|
| 3833 | - } |
|
| 3800 | + $c = 0; |
|
| 3801 | + foreach ($columns as $column ) {
|
|
| 3802 | + if ( $column == 'cat_id' ) {
|
|
| 3803 | + $cat_id = (int)$row[$c]; |
|
| 3804 | + } else if ( $column == 'cat_name' ) {
|
|
| 3805 | + $cat_name = $row[$c]; |
|
| 3806 | + } else if ( $column == 'cat_slug' ) {
|
|
| 3807 | + $cat_slug = $row[$c]; |
|
| 3808 | + } else if ( $column == 'cat_posttype' ) {
|
|
| 3809 | + $cat_posttype = $row[$c]; |
|
| 3810 | + } else if ( $column == 'cat_parent' ) {
|
|
| 3811 | + $cat_parent = trim($row[$c]); |
|
| 3812 | + } else if ( $column == 'cat_schema' && $row[$c] != '' ) {
|
|
| 3813 | + $cat_schema = $row[$c]; |
|
| 3814 | + } else if ( $column == 'cat_description' ) {
|
|
| 3815 | + $cat_description = $row[$c]; |
|
| 3816 | + } else if ( $column == 'cat_top_description' ) {
|
|
| 3817 | + $cat_top_description = $row[$c]; |
|
| 3818 | + } else if ( $column == 'cat_image' ) {
|
|
| 3819 | + $cat_image = $row[$c]; |
|
| 3820 | + } else if ( $column == 'cat_icon' ) {
|
|
| 3821 | + $cat_icon = $row[$c]; |
|
| 3822 | + } |
|
| 3823 | + // WPML |
|
| 3824 | + if ( $is_wpml ) {
|
|
| 3825 | + if ( $column == 'cat_language' ) {
|
|
| 3826 | + $cat_language = geodir_strtolower( trim( $row[$c] ) ); |
|
| 3827 | + } else if ( $column == 'cat_id_original' ) {
|
|
| 3828 | + $cat_id_original = (int)$row[$c]; |
|
| 3829 | + } |
|
| 3830 | + } |
|
| 3831 | + // WPML |
|
| 3832 | + $c++; |
|
| 3833 | + } |
|
| 3834 | 3834 | |
| 3835 | - if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) {
|
|
| 3836 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
| 3835 | + if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) {
|
|
| 3836 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
| 3837 | 3837 | |
| 3838 | - $invalid++; |
|
| 3839 | - continue; |
|
| 3840 | - } |
|
| 3838 | + $invalid++; |
|
| 3839 | + continue; |
|
| 3840 | + } |
|
| 3841 | 3841 | |
| 3842 | - // WPML |
|
| 3843 | - if ($is_wpml && $cat_language != '') {
|
|
| 3844 | - $sitepress->switch_lang($cat_language, true); |
|
| 3845 | - } |
|
| 3846 | - // WPML |
|
| 3842 | + // WPML |
|
| 3843 | + if ($is_wpml && $cat_language != '') {
|
|
| 3844 | + $sitepress->switch_lang($cat_language, true); |
|
| 3845 | + } |
|
| 3846 | + // WPML |
|
| 3847 | 3847 | |
| 3848 | - $term_data = array(); |
|
| 3849 | - $term_data['name'] = $cat_name; |
|
| 3850 | - $term_data['slug'] = $cat_slug; |
|
| 3851 | - $term_data['description'] = $cat_description; |
|
| 3852 | - $term_data['cat_schema'] = $cat_schema; |
|
| 3853 | - $term_data['top_description'] = $cat_top_description; |
|
| 3854 | - $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : ''; |
|
| 3855 | - $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : ''; |
|
| 3848 | + $term_data = array(); |
|
| 3849 | + $term_data['name'] = $cat_name; |
|
| 3850 | + $term_data['slug'] = $cat_slug; |
|
| 3851 | + $term_data['description'] = $cat_description; |
|
| 3852 | + $term_data['cat_schema'] = $cat_schema; |
|
| 3853 | + $term_data['top_description'] = $cat_top_description; |
|
| 3854 | + $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : ''; |
|
| 3855 | + $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : ''; |
|
| 3856 | 3856 | |
| 3857 | - //$term_data = array_map( 'utf8_encode', $term_data ); |
|
| 3857 | + //$term_data = array_map( 'utf8_encode', $term_data ); |
|
| 3858 | 3858 | |
| 3859 | - $taxonomy = $cat_posttype . 'category'; |
|
| 3859 | + $taxonomy = $cat_posttype . 'category'; |
|
| 3860 | 3860 | |
| 3861 | - $term_data['taxonomy'] = $taxonomy; |
|
| 3861 | + $term_data['taxonomy'] = $taxonomy; |
|
| 3862 | 3862 | |
| 3863 | - $term_parent_id = 0; |
|
| 3864 | - if ($cat_parent != "" || (int)$cat_parent > 0) {
|
|
| 3865 | - $term_parent = ''; |
|
| 3863 | + $term_parent_id = 0; |
|
| 3864 | + if ($cat_parent != "" || (int)$cat_parent > 0) {
|
|
| 3865 | + $term_parent = ''; |
|
| 3866 | 3866 | |
| 3867 | - if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
|
|
| 3868 | - // |
|
| 3869 | - } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
|
|
| 3870 | - // |
|
| 3871 | - } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
|
|
| 3872 | - // |
|
| 3873 | - } else {
|
|
| 3874 | - $term_parent_data = array(); |
|
| 3875 | - $term_parent_data['name'] = $cat_parent; |
|
| 3876 | - //$term_parent_data = array_map( 'utf8_encode', $term_parent_data ); |
|
| 3877 | - $term_parent_data['taxonomy'] = $taxonomy; |
|
| 3867 | + if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
|
|
| 3868 | + // |
|
| 3869 | + } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
|
|
| 3870 | + // |
|
| 3871 | + } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
|
|
| 3872 | + // |
|
| 3873 | + } else {
|
|
| 3874 | + $term_parent_data = array(); |
|
| 3875 | + $term_parent_data['name'] = $cat_parent; |
|
| 3876 | + //$term_parent_data = array_map( 'utf8_encode', $term_parent_data ); |
|
| 3877 | + $term_parent_data['taxonomy'] = $taxonomy; |
|
| 3878 | 3878 | |
| 3879 | - $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data ); |
|
| 3880 | - } |
|
| 3879 | + $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data ); |
|
| 3880 | + } |
|
| 3881 | 3881 | |
| 3882 | - if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
|
|
| 3883 | - $term_parent_id = (int)$term_parent->term_id; |
|
| 3884 | - } |
|
| 3885 | - } |
|
| 3886 | - $term_data['parent'] = (int)$term_parent_id; |
|
| 3882 | + if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
|
|
| 3883 | + $term_parent_id = (int)$term_parent->term_id; |
|
| 3884 | + } |
|
| 3885 | + } |
|
| 3886 | + $term_data['parent'] = (int)$term_parent_id; |
|
| 3887 | 3887 | |
| 3888 | - $term_id = NULL; |
|
| 3889 | - if ( $import_choice == 'update' ) {
|
|
| 3890 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 3891 | - $term_data['term_id'] = $term['term_id']; |
|
| 3888 | + $term_id = NULL; |
|
| 3889 | + if ( $import_choice == 'update' ) {
|
|
| 3890 | + if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 3891 | + $term_data['term_id'] = $term['term_id']; |
|
| 3892 | 3892 | |
| 3893 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 3894 | - $updated++; |
|
| 3895 | - } else {
|
|
| 3896 | - $invalid++; |
|
| 3897 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3898 | - } |
|
| 3899 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 3900 | - $term_data['term_id'] = $term['term_id']; |
|
| 3893 | + if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 3894 | + $updated++; |
|
| 3895 | + } else {
|
|
| 3896 | + $invalid++; |
|
| 3897 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3898 | + } |
|
| 3899 | + } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 3900 | + $term_data['term_id'] = $term['term_id']; |
|
| 3901 | 3901 | |
| 3902 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 3903 | - $updated++; |
|
| 3904 | - } else {
|
|
| 3905 | - $invalid++; |
|
| 3906 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3907 | - } |
|
| 3908 | - } else {
|
|
| 3909 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 3910 | - $created++; |
|
| 3911 | - } else {
|
|
| 3912 | - $invalid++; |
|
| 3913 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3914 | - } |
|
| 3915 | - } |
|
| 3916 | - } else if ( $import_choice == 'skip' ) {
|
|
| 3917 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 3918 | - $skipped++; |
|
| 3919 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 3920 | - $skipped++; |
|
| 3921 | - } else {
|
|
| 3922 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 3923 | - $created++; |
|
| 3924 | - } else {
|
|
| 3925 | - $invalid++; |
|
| 3926 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3927 | - } |
|
| 3928 | - } |
|
| 3929 | - } else {
|
|
| 3930 | - $invalid++; |
|
| 3931 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3932 | - } |
|
| 3902 | + if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 3903 | + $updated++; |
|
| 3904 | + } else {
|
|
| 3905 | + $invalid++; |
|
| 3906 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3907 | + } |
|
| 3908 | + } else {
|
|
| 3909 | + if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 3910 | + $created++; |
|
| 3911 | + } else {
|
|
| 3912 | + $invalid++; |
|
| 3913 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3914 | + } |
|
| 3915 | + } |
|
| 3916 | + } else if ( $import_choice == 'skip' ) {
|
|
| 3917 | + if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 3918 | + $skipped++; |
|
| 3919 | + } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 3920 | + $skipped++; |
|
| 3921 | + } else {
|
|
| 3922 | + if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 3923 | + $created++; |
|
| 3924 | + } else {
|
|
| 3925 | + $invalid++; |
|
| 3926 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3927 | + } |
|
| 3928 | + } |
|
| 3929 | + } else {
|
|
| 3930 | + $invalid++; |
|
| 3931 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
| 3932 | + } |
|
| 3933 | 3933 | |
| 3934 | - if ( $term_id ) {
|
|
| 3935 | - // WPML |
|
| 3936 | - if ($is_wpml && $cat_id_original > 0 && $cat_language != '') {
|
|
| 3937 | - $wpml_element_type = 'tax_' . $taxonomy; |
|
| 3938 | - $source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type ); |
|
| 3939 | - $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
|
| 3940 | - |
|
| 3941 | - $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type ); |
|
| 3934 | + if ( $term_id ) {
|
|
| 3935 | + // WPML |
|
| 3936 | + if ($is_wpml && $cat_id_original > 0 && $cat_language != '') {
|
|
| 3937 | + $wpml_element_type = 'tax_' . $taxonomy; |
|
| 3938 | + $source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type ); |
|
| 3939 | + $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
|
| 3940 | + |
|
| 3941 | + $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type ); |
|
| 3942 | 3942 | |
| 3943 | - $sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language ); |
|
| 3944 | - } |
|
| 3945 | - // WPML |
|
| 3943 | + $sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language ); |
|
| 3944 | + } |
|
| 3945 | + // WPML |
|
| 3946 | 3946 | |
| 3947 | - if ( isset( $term_data['top_description'] ) ) {
|
|
| 3948 | - update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype ); |
|
| 3949 | - } |
|
| 3947 | + if ( isset( $term_data['top_description'] ) ) {
|
|
| 3948 | + update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype ); |
|
| 3949 | + } |
|
| 3950 | 3950 | |
| 3951 | - if ( isset( $term_data['cat_schema'] ) ) {
|
|
| 3952 | - update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype ); |
|
| 3953 | - } |
|
| 3951 | + if ( isset( $term_data['cat_schema'] ) ) {
|
|
| 3952 | + update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype ); |
|
| 3953 | + } |
|
| 3954 | 3954 | |
| 3955 | - $attachment = false; |
|
| 3956 | - if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) {
|
|
| 3957 | - $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype ); |
|
| 3958 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
| 3955 | + $attachment = false; |
|
| 3956 | + if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) {
|
|
| 3957 | + $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype ); |
|
| 3958 | + $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
| 3959 | 3959 | |
| 3960 | - if ( basename($cat_image) != $term_data['image'] ) {
|
|
| 3961 | - $attachment = true; |
|
| 3962 | - update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype ); |
|
| 3963 | - } |
|
| 3964 | - } |
|
| 3960 | + if ( basename($cat_image) != $term_data['image'] ) {
|
|
| 3961 | + $attachment = true; |
|
| 3962 | + update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype ); |
|
| 3963 | + } |
|
| 3964 | + } |
|
| 3965 | 3965 | |
| 3966 | - if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) {
|
|
| 3967 | - $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype ); |
|
| 3968 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
| 3966 | + if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) {
|
|
| 3967 | + $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype ); |
|
| 3968 | + $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
| 3969 | 3969 | |
| 3970 | - if ( basename($cat_icon) != $term_data['icon'] ) {
|
|
| 3971 | - $attachment = true; |
|
| 3972 | - update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype ); |
|
| 3973 | - } |
|
| 3974 | - } |
|
| 3970 | + if ( basename($cat_icon) != $term_data['icon'] ) {
|
|
| 3971 | + $attachment = true; |
|
| 3972 | + update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype ); |
|
| 3973 | + } |
|
| 3974 | + } |
|
| 3975 | 3975 | |
| 3976 | - if ( $attachment ) {
|
|
| 3977 | - $images++; |
|
| 3978 | - } |
|
| 3979 | - } |
|
| 3976 | + if ( $attachment ) {
|
|
| 3977 | + $images++; |
|
| 3978 | + } |
|
| 3979 | + } |
|
| 3980 | 3980 | |
| 3981 | - // WPML |
|
| 3982 | - if ($is_wpml && $cat_language != '') {
|
|
| 3983 | - $sitepress->switch_lang($active_lang, true); |
|
| 3984 | - } |
|
| 3985 | - // WPML |
|
| 3986 | - } |
|
| 3987 | - } |
|
| 3988 | - } |
|
| 3981 | + // WPML |
|
| 3982 | + if ($is_wpml && $cat_language != '') {
|
|
| 3983 | + $sitepress->switch_lang($active_lang, true); |
|
| 3984 | + } |
|
| 3985 | + // WPML |
|
| 3986 | + } |
|
| 3987 | + } |
|
| 3988 | + } |
|
| 3989 | 3989 | |
| 3990 | - $json = array(); |
|
| 3991 | - $json['processed'] = $limit; |
|
| 3992 | - $json['created'] = $created; |
|
| 3993 | - $json['updated'] = $updated; |
|
| 3994 | - $json['skipped'] = $skipped; |
|
| 3995 | - $json['invalid'] = $invalid; |
|
| 3996 | - $json['images'] = $images; |
|
| 3990 | + $json = array(); |
|
| 3991 | + $json['processed'] = $limit; |
|
| 3992 | + $json['created'] = $created; |
|
| 3993 | + $json['updated'] = $updated; |
|
| 3994 | + $json['skipped'] = $skipped; |
|
| 3995 | + $json['invalid'] = $invalid; |
|
| 3996 | + $json['images'] = $images; |
|
| 3997 | 3997 | |
| 3998 | - wp_send_json( $json ); |
|
| 3999 | - exit; |
|
| 4000 | - } else if ( $task == 'import_post' ) {
|
|
| 4001 | - //run some stuff to make the import quicker |
|
| 4002 | - wp_defer_term_counting( true ); |
|
| 4003 | - wp_defer_comment_counting( true ); |
|
| 4004 | - $wpdb->query( 'SET autocommit = 0;' ); |
|
| 4005 | - |
|
| 4006 | - //remove_all_actions('publish_post');
|
|
| 4007 | - //remove_all_actions('transition_post_status');
|
|
| 4008 | - //remove_all_actions('publish_future_post');
|
|
| 4009 | - |
|
| 4010 | - if (!empty($file)) {
|
|
| 4011 | - $is_claim_active = is_plugin_active( 'geodir_claim_listing/geodir_claim_listing.php' ) && get_option('geodir_claim_enable') === 'yes' ? true : false;
|
|
| 4012 | - $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. |
|
| 4013 | - $default_status = 'publish'; |
|
| 4014 | - $current_date = date_i18n( 'Y-m-d', time() ); |
|
| 3998 | + wp_send_json( $json ); |
|
| 3999 | + exit; |
|
| 4000 | + } else if ( $task == 'import_post' ) {
|
|
| 4001 | + //run some stuff to make the import quicker |
|
| 4002 | + wp_defer_term_counting( true ); |
|
| 4003 | + wp_defer_comment_counting( true ); |
|
| 4004 | + $wpdb->query( 'SET autocommit = 0;' ); |
|
| 4005 | + |
|
| 4006 | + //remove_all_actions('publish_post');
|
|
| 4007 | + //remove_all_actions('transition_post_status');
|
|
| 4008 | + //remove_all_actions('publish_future_post');
|
|
| 4009 | + |
|
| 4010 | + if (!empty($file)) {
|
|
| 4011 | + $is_claim_active = is_plugin_active( 'geodir_claim_listing/geodir_claim_listing.php' ) && get_option('geodir_claim_enable') === 'yes' ? true : false;
|
|
| 4012 | + $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. |
|
| 4013 | + $default_status = 'publish'; |
|
| 4014 | + $current_date = date_i18n( 'Y-m-d', time() ); |
|
| 4015 | 4015 | |
| 4016 | - $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 4016 | + $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 4017 | 4017 | |
| 4018 | - if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 4019 | - $json['error'] = CSV_INVAILD_FILE; |
|
| 4020 | - wp_send_json( $json ); |
|
| 4021 | - exit; |
|
| 4022 | - } |
|
| 4018 | + if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 4019 | + $json['error'] = CSV_INVAILD_FILE; |
|
| 4020 | + wp_send_json( $json ); |
|
| 4021 | + exit; |
|
| 4022 | + } |
|
| 4023 | 4023 | |
| 4024 | - $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory');
|
|
| 4025 | - $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' ); |
|
| 4026 | - $processed_actual = 0; |
|
| 4027 | - for ($i = 1; $i <= $limit; $i++) {
|
|
| 4028 | - $index = $processed + $i; |
|
| 4029 | - $gd_post = array(); |
|
| 4024 | + $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory');
|
|
| 4025 | + $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' ); |
|
| 4026 | + $processed_actual = 0; |
|
| 4027 | + for ($i = 1; $i <= $limit; $i++) {
|
|
| 4028 | + $index = $processed + $i; |
|
| 4029 | + $gd_post = array(); |
|
| 4030 | 4030 | |
| 4031 | - if (isset($file[$index])) {
|
|
| 4032 | - $processed_actual++; |
|
| 4033 | - $row = $file[$index]; |
|
| 4034 | - $row = array_map( 'trim', $row ); |
|
| 4035 | - //$row = array_map( 'utf8_encode', $row ); |
|
| 4036 | - $row = array_map( 'addslashes_gpc', $row ); |
|
| 4031 | + if (isset($file[$index])) {
|
|
| 4032 | + $processed_actual++; |
|
| 4033 | + $row = $file[$index]; |
|
| 4034 | + $row = array_map( 'trim', $row ); |
|
| 4035 | + //$row = array_map( 'utf8_encode', $row ); |
|
| 4036 | + $row = array_map( 'addslashes_gpc', $row ); |
|
| 4037 | 4037 | |
| 4038 | - $post_id = ''; |
|
| 4039 | - $post_title = ''; |
|
| 4040 | - $post_author = ''; |
|
| 4041 | - $post_content = ''; |
|
| 4042 | - $post_category_arr = array(); |
|
| 4043 | - $default_category = ''; |
|
| 4044 | - $post_tags = array(); |
|
| 4045 | - $post_type = ''; |
|
| 4046 | - $post_status = ''; |
|
| 4047 | - $geodir_video = ''; |
|
| 4048 | - $post_address = ''; |
|
| 4049 | - $post_city = ''; |
|
| 4050 | - $post_region = ''; |
|
| 4051 | - $post_country = ''; |
|
| 4052 | - $post_zip = ''; |
|
| 4053 | - $post_latitude = ''; |
|
| 4054 | - $post_longitude = ''; |
|
| 4055 | - $post_neighbourhood = ''; |
|
| 4056 | - $neighbourhood_latitude = ''; |
|
| 4057 | - $neighbourhood_longitude = ''; |
|
| 4058 | - $geodir_timing = ''; |
|
| 4059 | - $geodir_contact = ''; |
|
| 4060 | - $geodir_email = ''; |
|
| 4061 | - $geodir_website = ''; |
|
| 4062 | - $geodir_twitter = ''; |
|
| 4063 | - $geodir_facebook = ''; |
|
| 4064 | - $geodir_twitter = ''; |
|
| 4065 | - $post_images = array(); |
|
| 4038 | + $post_id = ''; |
|
| 4039 | + $post_title = ''; |
|
| 4040 | + $post_author = ''; |
|
| 4041 | + $post_content = ''; |
|
| 4042 | + $post_category_arr = array(); |
|
| 4043 | + $default_category = ''; |
|
| 4044 | + $post_tags = array(); |
|
| 4045 | + $post_type = ''; |
|
| 4046 | + $post_status = ''; |
|
| 4047 | + $geodir_video = ''; |
|
| 4048 | + $post_address = ''; |
|
| 4049 | + $post_city = ''; |
|
| 4050 | + $post_region = ''; |
|
| 4051 | + $post_country = ''; |
|
| 4052 | + $post_zip = ''; |
|
| 4053 | + $post_latitude = ''; |
|
| 4054 | + $post_longitude = ''; |
|
| 4055 | + $post_neighbourhood = ''; |
|
| 4056 | + $neighbourhood_latitude = ''; |
|
| 4057 | + $neighbourhood_longitude = ''; |
|
| 4058 | + $geodir_timing = ''; |
|
| 4059 | + $geodir_contact = ''; |
|
| 4060 | + $geodir_email = ''; |
|
| 4061 | + $geodir_website = ''; |
|
| 4062 | + $geodir_twitter = ''; |
|
| 4063 | + $geodir_facebook = ''; |
|
| 4064 | + $geodir_twitter = ''; |
|
| 4065 | + $post_images = array(); |
|
| 4066 | 4066 | |
| 4067 | - $expire_date = 'Never'; |
|
| 4067 | + $expire_date = 'Never'; |
|
| 4068 | 4068 | |
| 4069 | - $language = ''; |
|
| 4070 | - $original_post_id = ''; |
|
| 4069 | + $language = ''; |
|
| 4070 | + $original_post_id = ''; |
|
| 4071 | 4071 | |
| 4072 | - $c = 0; |
|
| 4073 | - foreach ($columns as $column ) {
|
|
| 4074 | - $gd_post[$column] = $row[$c]; |
|
| 4072 | + $c = 0; |
|
| 4073 | + foreach ($columns as $column ) {
|
|
| 4074 | + $gd_post[$column] = $row[$c]; |
|
| 4075 | 4075 | |
| 4076 | - if ( $column == 'post_id' ) {
|
|
| 4077 | - $post_id = $row[$c]; |
|
| 4078 | - } else if ( $column == 'post_title' ) {
|
|
| 4079 | - $post_title = sanitize_text_field($row[$c]); |
|
| 4080 | - } else if ( $column == 'post_author' ) {
|
|
| 4081 | - $post_author = $row[$c]; |
|
| 4082 | - } else if ( $column == 'post_content' ) {
|
|
| 4083 | - $post_content = $row[$c]; |
|
| 4084 | - } else if ( $column == 'post_category' && $row[$c] != '' ) {
|
|
| 4085 | - $post_category_arr = explode( ',', $row[$c] ); |
|
| 4086 | - } else if ( $column == 'default_category' ) {
|
|
| 4087 | - $default_category = wp_kses_normalize_entities($row[$c]); |
|
| 4088 | - } else if ( $column == 'post_tags' && $row[$c] != '' ) {
|
|
| 4089 | - $post_tags = explode( ',', sanitize_text_field($row[$c]) ); |
|
| 4090 | - } else if ( $column == 'post_type' ) {
|
|
| 4091 | - $post_type = $row[$c]; |
|
| 4092 | - } else if ( $column == 'post_status' ) {
|
|
| 4093 | - $post_status = sanitize_key( $row[$c] ); |
|
| 4094 | - } else if ( $column == 'is_featured' ) {
|
|
| 4095 | - $is_featured = (int)$row[$c]; |
|
| 4096 | - } else if ( $column == 'geodir_video' ) {
|
|
| 4097 | - $geodir_video = $row[$c]; |
|
| 4098 | - } else if ( $column == 'post_address' ) {
|
|
| 4099 | - $post_address = sanitize_text_field($row[$c]); |
|
| 4100 | - } else if ( $column == 'post_city' ) {
|
|
| 4101 | - $post_city = sanitize_text_field($row[$c]); |
|
| 4102 | - } else if ( $column == 'post_region' ) {
|
|
| 4103 | - $post_region = sanitize_text_field($row[$c]); |
|
| 4104 | - } else if ( $column == 'post_country' ) {
|
|
| 4105 | - $post_country = sanitize_text_field($row[$c]); |
|
| 4106 | - } else if ( $column == 'post_zip' ) {
|
|
| 4107 | - $post_zip = sanitize_text_field($row[$c]); |
|
| 4108 | - } else if ( $column == 'post_latitude' ) {
|
|
| 4109 | - $post_latitude = sanitize_text_field($row[$c]); |
|
| 4110 | - } else if ( $column == 'post_longitude' ) {
|
|
| 4111 | - $post_longitude = sanitize_text_field($row[$c]); |
|
| 4112 | - } else if ( $column == 'post_neighbourhood' ) {
|
|
| 4113 | - $post_neighbourhood = sanitize_text_field($row[$c]); |
|
| 4114 | - unset($gd_post[$column]); |
|
| 4115 | - } else if ( $column == 'neighbourhood_latitude' ) {
|
|
| 4116 | - $neighbourhood_latitude = sanitize_text_field($row[$c]); |
|
| 4117 | - } else if ( $column == 'neighbourhood_longitude' ) {
|
|
| 4118 | - $neighbourhood_longitude = sanitize_text_field($row[$c]); |
|
| 4119 | - } else if ( $column == 'geodir_timing' ) {
|
|
| 4120 | - $geodir_timing = sanitize_text_field($row[$c]); |
|
| 4121 | - } else if ( $column == 'geodir_contact' ) {
|
|
| 4122 | - $geodir_contact = sanitize_text_field($row[$c]); |
|
| 4123 | - } else if ( $column == 'geodir_email' ) {
|
|
| 4124 | - $geodir_email = sanitize_email($row[$c]); |
|
| 4125 | - } else if ( $column == 'geodir_website' ) {
|
|
| 4126 | - $geodir_website = sanitize_text_field($row[$c]); |
|
| 4127 | - } else if ( $column == 'geodir_twitter' ) {
|
|
| 4128 | - $geodir_twitter = sanitize_text_field($row[$c]); |
|
| 4129 | - } else if ( $column == 'geodir_facebook' ) {
|
|
| 4130 | - $geodir_facebook = sanitize_text_field($row[$c]); |
|
| 4131 | - } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
|
|
| 4132 | - $post_images[] = $row[$c]; |
|
| 4133 | - } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) {
|
|
| 4134 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) ); |
|
| 4135 | - } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) {
|
|
| 4136 | - $row[$c] = str_replace('/', '-', $row[$c]);
|
|
| 4137 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) ); |
|
| 4138 | - } |
|
| 4139 | - // WPML |
|
| 4140 | - if ($is_wpml) {
|
|
| 4141 | - if ($column == 'language') {
|
|
| 4142 | - $language = geodir_strtolower(trim($row[$c])); |
|
| 4143 | - } else if ($column == 'original_post_id') {
|
|
| 4144 | - $original_post_id = (int)$row[$c]; |
|
| 4145 | - } |
|
| 4146 | - } |
|
| 4147 | - // WPML |
|
| 4148 | - $c++; |
|
| 4149 | - } |
|
| 4150 | - // listing claimed or not |
|
| 4151 | - if ($is_claim_active && isset($gd_post['claimed'])) {
|
|
| 4152 | - $gd_post['claimed'] = (int)$gd_post['claimed'] == 1 ? 1 : 0; |
|
| 4153 | - } |
|
| 4076 | + if ( $column == 'post_id' ) {
|
|
| 4077 | + $post_id = $row[$c]; |
|
| 4078 | + } else if ( $column == 'post_title' ) {
|
|
| 4079 | + $post_title = sanitize_text_field($row[$c]); |
|
| 4080 | + } else if ( $column == 'post_author' ) {
|
|
| 4081 | + $post_author = $row[$c]; |
|
| 4082 | + } else if ( $column == 'post_content' ) {
|
|
| 4083 | + $post_content = $row[$c]; |
|
| 4084 | + } else if ( $column == 'post_category' && $row[$c] != '' ) {
|
|
| 4085 | + $post_category_arr = explode( ',', $row[$c] ); |
|
| 4086 | + } else if ( $column == 'default_category' ) {
|
|
| 4087 | + $default_category = wp_kses_normalize_entities($row[$c]); |
|
| 4088 | + } else if ( $column == 'post_tags' && $row[$c] != '' ) {
|
|
| 4089 | + $post_tags = explode( ',', sanitize_text_field($row[$c]) ); |
|
| 4090 | + } else if ( $column == 'post_type' ) {
|
|
| 4091 | + $post_type = $row[$c]; |
|
| 4092 | + } else if ( $column == 'post_status' ) {
|
|
| 4093 | + $post_status = sanitize_key( $row[$c] ); |
|
| 4094 | + } else if ( $column == 'is_featured' ) {
|
|
| 4095 | + $is_featured = (int)$row[$c]; |
|
| 4096 | + } else if ( $column == 'geodir_video' ) {
|
|
| 4097 | + $geodir_video = $row[$c]; |
|
| 4098 | + } else if ( $column == 'post_address' ) {
|
|
| 4099 | + $post_address = sanitize_text_field($row[$c]); |
|
| 4100 | + } else if ( $column == 'post_city' ) {
|
|
| 4101 | + $post_city = sanitize_text_field($row[$c]); |
|
| 4102 | + } else if ( $column == 'post_region' ) {
|
|
| 4103 | + $post_region = sanitize_text_field($row[$c]); |
|
| 4104 | + } else if ( $column == 'post_country' ) {
|
|
| 4105 | + $post_country = sanitize_text_field($row[$c]); |
|
| 4106 | + } else if ( $column == 'post_zip' ) {
|
|
| 4107 | + $post_zip = sanitize_text_field($row[$c]); |
|
| 4108 | + } else if ( $column == 'post_latitude' ) {
|
|
| 4109 | + $post_latitude = sanitize_text_field($row[$c]); |
|
| 4110 | + } else if ( $column == 'post_longitude' ) {
|
|
| 4111 | + $post_longitude = sanitize_text_field($row[$c]); |
|
| 4112 | + } else if ( $column == 'post_neighbourhood' ) {
|
|
| 4113 | + $post_neighbourhood = sanitize_text_field($row[$c]); |
|
| 4114 | + unset($gd_post[$column]); |
|
| 4115 | + } else if ( $column == 'neighbourhood_latitude' ) {
|
|
| 4116 | + $neighbourhood_latitude = sanitize_text_field($row[$c]); |
|
| 4117 | + } else if ( $column == 'neighbourhood_longitude' ) {
|
|
| 4118 | + $neighbourhood_longitude = sanitize_text_field($row[$c]); |
|
| 4119 | + } else if ( $column == 'geodir_timing' ) {
|
|
| 4120 | + $geodir_timing = sanitize_text_field($row[$c]); |
|
| 4121 | + } else if ( $column == 'geodir_contact' ) {
|
|
| 4122 | + $geodir_contact = sanitize_text_field($row[$c]); |
|
| 4123 | + } else if ( $column == 'geodir_email' ) {
|
|
| 4124 | + $geodir_email = sanitize_email($row[$c]); |
|
| 4125 | + } else if ( $column == 'geodir_website' ) {
|
|
| 4126 | + $geodir_website = sanitize_text_field($row[$c]); |
|
| 4127 | + } else if ( $column == 'geodir_twitter' ) {
|
|
| 4128 | + $geodir_twitter = sanitize_text_field($row[$c]); |
|
| 4129 | + } else if ( $column == 'geodir_facebook' ) {
|
|
| 4130 | + $geodir_facebook = sanitize_text_field($row[$c]); |
|
| 4131 | + } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
|
|
| 4132 | + $post_images[] = $row[$c]; |
|
| 4133 | + } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) {
|
|
| 4134 | + $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) ); |
|
| 4135 | + } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) {
|
|
| 4136 | + $row[$c] = str_replace('/', '-', $row[$c]);
|
|
| 4137 | + $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) ); |
|
| 4138 | + } |
|
| 4139 | + // WPML |
|
| 4140 | + if ($is_wpml) {
|
|
| 4141 | + if ($column == 'language') {
|
|
| 4142 | + $language = geodir_strtolower(trim($row[$c])); |
|
| 4143 | + } else if ($column == 'original_post_id') {
|
|
| 4144 | + $original_post_id = (int)$row[$c]; |
|
| 4145 | + } |
|
| 4146 | + } |
|
| 4147 | + // WPML |
|
| 4148 | + $c++; |
|
| 4149 | + } |
|
| 4150 | + // listing claimed or not |
|
| 4151 | + if ($is_claim_active && isset($gd_post['claimed'])) {
|
|
| 4152 | + $gd_post['claimed'] = (int)$gd_post['claimed'] == 1 ? 1 : 0; |
|
| 4153 | + } |
|
| 4154 | 4154 | |
| 4155 | - // WPML |
|
| 4156 | - if ($is_wpml && $language != '') {
|
|
| 4157 | - $sitepress->switch_lang($language, true); |
|
| 4158 | - } |
|
| 4159 | - // WPML |
|
| 4155 | + // WPML |
|
| 4156 | + if ($is_wpml && $language != '') {
|
|
| 4157 | + $sitepress->switch_lang($language, true); |
|
| 4158 | + } |
|
| 4159 | + // WPML |
|
| 4160 | 4160 | |
| 4161 | - $gd_post['IMAGE'] = $post_images; |
|
| 4161 | + $gd_post['IMAGE'] = $post_images; |
|
| 4162 | 4162 | |
| 4163 | - $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
| 4164 | - $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
| 4163 | + $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
| 4164 | + $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
| 4165 | 4165 | |
| 4166 | - $valid = true; |
|
| 4166 | + $valid = true; |
|
| 4167 | 4167 | |
| 4168 | - if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
|
|
| 4169 | - $invalid++; |
|
| 4170 | - $valid = false; |
|
| 4171 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
| 4172 | - } |
|
| 4168 | + if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
|
|
| 4169 | + $invalid++; |
|
| 4170 | + $valid = false; |
|
| 4171 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
| 4172 | + } |
|
| 4173 | 4173 | |
| 4174 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
| 4175 | - if ( $location_allowed ) {
|
|
| 4176 | - $location_result = geodir_get_default_location(); |
|
| 4177 | - if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
|
|
| 4178 | - $invalid_addr++; |
|
| 4179 | - $valid = false; |
|
| 4180 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) ); |
|
| 4181 | - } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) {
|
|
| 4182 | - if ( ( geodir_strtolower( $post_city ) != geodir_strtolower( $location_result->city ) ) || ( geodir_strtolower( $post_region ) != geodir_strtolower( $location_result->region ) ) || (geodir_strtolower( $post_country ) != geodir_strtolower( $location_result->country ) ) ) {
|
|
| 4183 | - $invalid_addr++; |
|
| 4184 | - $valid = false; |
|
| 4185 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) ); |
|
| 4186 | - } else {
|
|
| 4187 | - if (!$location_manager) {
|
|
| 4188 | - $gd_post['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // Set the default location when location manager not activated. |
|
| 4189 | - } |
|
| 4190 | - } |
|
| 4191 | - } |
|
| 4192 | - } |
|
| 4174 | + $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
| 4175 | + if ( $location_allowed ) {
|
|
| 4176 | + $location_result = geodir_get_default_location(); |
|
| 4177 | + if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
|
|
| 4178 | + $invalid_addr++; |
|
| 4179 | + $valid = false; |
|
| 4180 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) ); |
|
| 4181 | + } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) {
|
|
| 4182 | + if ( ( geodir_strtolower( $post_city ) != geodir_strtolower( $location_result->city ) ) || ( geodir_strtolower( $post_region ) != geodir_strtolower( $location_result->region ) ) || (geodir_strtolower( $post_country ) != geodir_strtolower( $location_result->country ) ) ) {
|
|
| 4183 | + $invalid_addr++; |
|
| 4184 | + $valid = false; |
|
| 4185 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) ); |
|
| 4186 | + } else {
|
|
| 4187 | + if (!$location_manager) {
|
|
| 4188 | + $gd_post['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // Set the default location when location manager not activated. |
|
| 4189 | + } |
|
| 4190 | + } |
|
| 4191 | + } |
|
| 4192 | + } |
|
| 4193 | 4193 | |
| 4194 | - if ( !$valid ) {
|
|
| 4195 | - continue; |
|
| 4196 | - } |
|
| 4194 | + if ( !$valid ) {
|
|
| 4195 | + continue; |
|
| 4196 | + } |
|
| 4197 | 4197 | |
| 4198 | - $cat_taxonomy = $post_type . 'category'; |
|
| 4199 | - $tags_taxonomy = $post_type . '_tags'; |
|
| 4198 | + $cat_taxonomy = $post_type . 'category'; |
|
| 4199 | + $tags_taxonomy = $post_type . '_tags'; |
|
| 4200 | 4200 | |
| 4201 | - if ($default_category != '' && !in_array($default_category, $post_category_arr)) {
|
|
| 4202 | - $post_category_arr = array_merge(array($default_category), $post_category_arr); |
|
| 4203 | - } |
|
| 4201 | + if ($default_category != '' && !in_array($default_category, $post_category_arr)) {
|
|
| 4202 | + $post_category_arr = array_merge(array($default_category), $post_category_arr); |
|
| 4203 | + } |
|
| 4204 | 4204 | |
| 4205 | - $post_category = array(); |
|
| 4206 | - $default_category_id = NULL; |
|
| 4207 | - if ( !empty( $post_category_arr ) ) {
|
|
| 4208 | - foreach ( $post_category_arr as $value ) {
|
|
| 4209 | - $category_name = wp_kses_normalize_entities( trim( $value ) ); |
|
| 4205 | + $post_category = array(); |
|
| 4206 | + $default_category_id = NULL; |
|
| 4207 | + if ( !empty( $post_category_arr ) ) {
|
|
| 4208 | + foreach ( $post_category_arr as $value ) {
|
|
| 4209 | + $category_name = wp_kses_normalize_entities( trim( $value ) ); |
|
| 4210 | 4210 | |
| 4211 | - if ( $category_name != '' ) {
|
|
| 4212 | - $term_category = array(); |
|
| 4211 | + if ( $category_name != '' ) {
|
|
| 4212 | + $term_category = array(); |
|
| 4213 | 4213 | |
| 4214 | - if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
|
|
| 4215 | - $term_category = $term; |
|
| 4216 | - } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
|
|
| 4217 | - $term_category = $term; |
|
| 4218 | - } else {
|
|
| 4219 | - $term_data = array(); |
|
| 4220 | - $term_data['name'] = $category_name; |
|
| 4221 | - $term_data['taxonomy'] = $cat_taxonomy; |
|
| 4214 | + if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
|
|
| 4215 | + $term_category = $term; |
|
| 4216 | + } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
|
|
| 4217 | + $term_category = $term; |
|
| 4218 | + } else {
|
|
| 4219 | + $term_data = array(); |
|
| 4220 | + $term_data['name'] = $category_name; |
|
| 4221 | + $term_data['taxonomy'] = $cat_taxonomy; |
|
| 4222 | 4222 | |
| 4223 | - $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data ); |
|
| 4224 | - if ( $term_id ) {
|
|
| 4225 | - $term_category = get_term( $term_id, $cat_taxonomy ); |
|
| 4226 | - } |
|
| 4227 | - } |
|
| 4223 | + $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data ); |
|
| 4224 | + if ( $term_id ) {
|
|
| 4225 | + $term_category = get_term( $term_id, $cat_taxonomy ); |
|
| 4226 | + } |
|
| 4227 | + } |
|
| 4228 | 4228 | |
| 4229 | - if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
|
|
| 4230 | - $post_category[] = intval($term_category->term_id); |
|
| 4229 | + if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
|
|
| 4230 | + $post_category[] = intval($term_category->term_id); |
|
| 4231 | 4231 | |
| 4232 | - if ($category_name == $default_category) {
|
|
| 4233 | - $default_category_id = intval($term_category->term_id); |
|
| 4234 | - } |
|
| 4235 | - } |
|
| 4236 | - } |
|
| 4237 | - } |
|
| 4238 | - } |
|
| 4232 | + if ($category_name == $default_category) {
|
|
| 4233 | + $default_category_id = intval($term_category->term_id); |
|
| 4234 | + } |
|
| 4235 | + } |
|
| 4236 | + } |
|
| 4237 | + } |
|
| 4238 | + } |
|
| 4239 | 4239 | |
| 4240 | - $save_post = array(); |
|
| 4241 | - $save_post['post_title'] = $post_title; |
|
| 4242 | - $save_post['post_content'] = $post_content; |
|
| 4243 | - $save_post['post_type'] = $post_type; |
|
| 4244 | - $save_post['post_author'] = $post_author; |
|
| 4245 | - $save_post['post_status'] = $post_status; |
|
| 4246 | - $save_post['post_category'] = $post_category; |
|
| 4247 | - $save_post['post_tags'] = $post_tags; |
|
| 4248 | - |
|
| 4249 | - $saved_post_id = NULL; |
|
| 4250 | - if ( $import_choice == 'update' ) {
|
|
| 4251 | - $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' ); |
|
| 4240 | + $save_post = array(); |
|
| 4241 | + $save_post['post_title'] = $post_title; |
|
| 4242 | + $save_post['post_content'] = $post_content; |
|
| 4243 | + $save_post['post_type'] = $post_type; |
|
| 4244 | + $save_post['post_author'] = $post_author; |
|
| 4245 | + $save_post['post_status'] = $post_status; |
|
| 4246 | + $save_post['post_category'] = $post_category; |
|
| 4247 | + $save_post['post_tags'] = $post_tags; |
|
| 4248 | + |
|
| 4249 | + $saved_post_id = NULL; |
|
| 4250 | + if ( $import_choice == 'update' ) {
|
|
| 4251 | + $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' ); |
|
| 4252 | 4252 | |
| 4253 | - if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 4254 | - $save_post['ID'] = $post_id; |
|
| 4253 | + if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 4254 | + $save_post['ID'] = $post_id; |
|
| 4255 | 4255 | |
| 4256 | - if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
|
|
| 4257 | - if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4258 | - $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
| 4259 | - $saved_post_id = 0; |
|
| 4260 | - } else {
|
|
| 4261 | - $saved_post_id = $post_id; |
|
| 4262 | - $updated++; |
|
| 4263 | - } |
|
| 4264 | - } |
|
| 4265 | - } else {
|
|
| 4266 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
|
|
| 4267 | - if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4268 | - $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
| 4269 | - $saved_post_id = 0; |
|
| 4270 | - } else {
|
|
| 4271 | - $created++; |
|
| 4272 | - } |
|
| 4273 | - } |
|
| 4274 | - } |
|
| 4256 | + if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
|
|
| 4257 | + if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4258 | + $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
| 4259 | + $saved_post_id = 0; |
|
| 4260 | + } else {
|
|
| 4261 | + $saved_post_id = $post_id; |
|
| 4262 | + $updated++; |
|
| 4263 | + } |
|
| 4264 | + } |
|
| 4265 | + } else {
|
|
| 4266 | + if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
|
|
| 4267 | + if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4268 | + $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
| 4269 | + $saved_post_id = 0; |
|
| 4270 | + } else {
|
|
| 4271 | + $created++; |
|
| 4272 | + } |
|
| 4273 | + } |
|
| 4274 | + } |
|
| 4275 | 4275 | |
| 4276 | - if ( !$saved_post_id > 0 ) {
|
|
| 4277 | - $invalid++; |
|
| 4278 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error ); |
|
| 4279 | - } |
|
| 4280 | - } else if ( $import_choice == 'skip' ) {
|
|
| 4281 | - if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 4282 | - $skipped++; |
|
| 4283 | - } else {
|
|
| 4284 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
|
|
| 4285 | - if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4286 | - $invalid++; |
|
| 4276 | + if ( !$saved_post_id > 0 ) {
|
|
| 4277 | + $invalid++; |
|
| 4278 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error ); |
|
| 4279 | + } |
|
| 4280 | + } else if ( $import_choice == 'skip' ) {
|
|
| 4281 | + if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 4282 | + $skipped++; |
|
| 4283 | + } else {
|
|
| 4284 | + if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
|
|
| 4285 | + if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4286 | + $invalid++; |
|
| 4287 | 4287 | |
| 4288 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error ); |
|
| 4289 | - $saved_post_id = 0; |
|
| 4290 | - } else {
|
|
| 4291 | - $created++; |
|
| 4292 | - } |
|
| 4293 | - } else {
|
|
| 4294 | - $invalid++; |
|
| 4288 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error ); |
|
| 4289 | + $saved_post_id = 0; |
|
| 4290 | + } else {
|
|
| 4291 | + $created++; |
|
| 4292 | + } |
|
| 4293 | + } else {
|
|
| 4294 | + $invalid++; |
|
| 4295 | 4295 | |
| 4296 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
| 4297 | - } |
|
| 4298 | - } |
|
| 4299 | - } else {
|
|
| 4300 | - $invalid++; |
|
| 4296 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
| 4297 | + } |
|
| 4298 | + } |
|
| 4299 | + } else {
|
|
| 4300 | + $invalid++; |
|
| 4301 | 4301 | |
| 4302 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
| 4303 | - } |
|
| 4302 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
| 4303 | + } |
|
| 4304 | 4304 | |
| 4305 | - if ( (int)$saved_post_id > 0 ) {
|
|
| 4306 | - // WPML |
|
| 4307 | - if ($is_wpml && $original_post_id > 0 && $language != '') {
|
|
| 4308 | - $wpml_post_type = 'post_' . $post_type; |
|
| 4309 | - $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type ); |
|
| 4310 | - $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
|
| 4305 | + if ( (int)$saved_post_id > 0 ) {
|
|
| 4306 | + // WPML |
|
| 4307 | + if ($is_wpml && $original_post_id > 0 && $language != '') {
|
|
| 4308 | + $wpml_post_type = 'post_' . $post_type; |
|
| 4309 | + $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type ); |
|
| 4310 | + $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
|
| 4311 | 4311 | |
| 4312 | - $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type ); |
|
| 4312 | + $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type ); |
|
| 4313 | 4313 | |
| 4314 | - $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language ); |
|
| 4315 | - } |
|
| 4316 | - // WPML |
|
| 4317 | - $gd_post_info = geodir_get_post_info( $saved_post_id ); |
|
| 4314 | + $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language ); |
|
| 4315 | + } |
|
| 4316 | + // WPML |
|
| 4317 | + $gd_post_info = geodir_get_post_info( $saved_post_id ); |
|
| 4318 | 4318 | |
| 4319 | - $gd_post['post_id'] = $saved_post_id; |
|
| 4320 | - $gd_post['ID'] = $saved_post_id; |
|
| 4321 | - $gd_post['post_tags'] = $post_tags; |
|
| 4322 | - $gd_post['post_title'] = $post_title; |
|
| 4323 | - $gd_post['post_status'] = $post_status; |
|
| 4324 | - $gd_post['submit_time'] = time(); |
|
| 4325 | - $gd_post['submit_ip'] = $_SERVER['REMOTE_ADDR']; |
|
| 4319 | + $gd_post['post_id'] = $saved_post_id; |
|
| 4320 | + $gd_post['ID'] = $saved_post_id; |
|
| 4321 | + $gd_post['post_tags'] = $post_tags; |
|
| 4322 | + $gd_post['post_title'] = $post_title; |
|
| 4323 | + $gd_post['post_status'] = $post_status; |
|
| 4324 | + $gd_post['submit_time'] = time(); |
|
| 4325 | + $gd_post['submit_ip'] = $_SERVER['REMOTE_ADDR']; |
|
| 4326 | 4326 | |
| 4327 | - // post location |
|
| 4328 | - $post_location_id = 0; |
|
| 4329 | - if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
|
|
| 4330 | - $gd_post['post_neighbourhood'] = ''; |
|
| 4327 | + // post location |
|
| 4328 | + $post_location_id = 0; |
|
| 4329 | + if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
|
|
| 4330 | + $gd_post['post_neighbourhood'] = ''; |
|
| 4331 | 4331 | |
| 4332 | - $post_location_info = array( |
|
| 4333 | - 'city' => $post_city, |
|
| 4334 | - 'region' => $post_region, |
|
| 4335 | - 'country' => $post_country, |
|
| 4336 | - 'geo_lat' => $post_latitude, |
|
| 4337 | - 'geo_lng' => $post_longitude |
|
| 4338 | - ); |
|
| 4339 | - if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
|
|
| 4340 | - $post_location_id = $location_id; |
|
| 4341 | - } |
|
| 4332 | + $post_location_info = array( |
|
| 4333 | + 'city' => $post_city, |
|
| 4334 | + 'region' => $post_region, |
|
| 4335 | + 'country' => $post_country, |
|
| 4336 | + 'geo_lat' => $post_latitude, |
|
| 4337 | + 'geo_lng' => $post_longitude |
|
| 4338 | + ); |
|
| 4339 | + if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
|
|
| 4340 | + $post_location_id = $location_id; |
|
| 4341 | + } |
|
| 4342 | 4342 | |
| 4343 | - if ($post_location_id > 0 && $neighbourhood_active && !empty($post_neighbourhood)) {
|
|
| 4344 | - $neighbourhood_info = geodir_location_neighbourhood_by_name_loc_id($post_neighbourhood, $post_location_id); |
|
| 4343 | + if ($post_location_id > 0 && $neighbourhood_active && !empty($post_neighbourhood)) {
|
|
| 4344 | + $neighbourhood_info = geodir_location_neighbourhood_by_name_loc_id($post_neighbourhood, $post_location_id); |
|
| 4345 | 4345 | |
| 4346 | - $hood_data = array(); |
|
| 4347 | - $hood_data['hood_location_id'] = $post_location_id; |
|
| 4348 | - $hood_data['hood_name'] = $post_neighbourhood; |
|
| 4346 | + $hood_data = array(); |
|
| 4347 | + $hood_data['hood_location_id'] = $post_location_id; |
|
| 4348 | + $hood_data['hood_name'] = $post_neighbourhood; |
|
| 4349 | 4349 | |
| 4350 | - if (!empty($neighbourhood_info)) {
|
|
| 4351 | - $hood_data['hood_id'] = $neighbourhood_info->hood_id; |
|
| 4352 | - $hood_data['hood_slug'] = $neighbourhood_info->hood_slug; |
|
| 4350 | + if (!empty($neighbourhood_info)) {
|
|
| 4351 | + $hood_data['hood_id'] = $neighbourhood_info->hood_id; |
|
| 4352 | + $hood_data['hood_slug'] = $neighbourhood_info->hood_slug; |
|
| 4353 | 4353 | |
| 4354 | - if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
|
|
| 4355 | - $neighbourhood_latitude = $neighbourhood_info->hood_latitude; |
|
| 4356 | - $neighbourhood_longitude = $neighbourhood_info->hood_longitude; |
|
| 4357 | - } |
|
| 4358 | - } |
|
| 4354 | + if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
|
|
| 4355 | + $neighbourhood_latitude = $neighbourhood_info->hood_latitude; |
|
| 4356 | + $neighbourhood_longitude = $neighbourhood_info->hood_longitude; |
|
| 4357 | + } |
|
| 4358 | + } |
|
| 4359 | 4359 | |
| 4360 | - if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
|
|
| 4361 | - $neighbourhood_latitude = $neighbourhood_info->hood_latitude; |
|
| 4362 | - $neighbourhood_longitude = $neighbourhood_info->hood_longitude; |
|
| 4363 | - } |
|
| 4360 | + if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
|
|
| 4361 | + $neighbourhood_latitude = $neighbourhood_info->hood_latitude; |
|
| 4362 | + $neighbourhood_longitude = $neighbourhood_info->hood_longitude; |
|
| 4363 | + } |
|
| 4364 | 4364 | |
| 4365 | - $hood_data['hood_latitude'] = $post_latitude; |
|
| 4366 | - $hood_data['hood_longitude'] = $post_longitude; |
|
| 4367 | - |
|
| 4368 | - $neighbourhood_info = geodir_location_insert_update_neighbourhood($hood_data); |
|
| 4369 | - if (!empty($neighbourhood_info) && isset($neighbourhood_info->hood_slug)) {
|
|
| 4370 | - $gd_post['post_neighbourhood'] = $neighbourhood_info->hood_slug; |
|
| 4371 | - } |
|
| 4372 | - } |
|
| 4373 | - } |
|
| 4374 | - $gd_post['post_location_id'] = $post_location_id; |
|
| 4365 | + $hood_data['hood_latitude'] = $post_latitude; |
|
| 4366 | + $hood_data['hood_longitude'] = $post_longitude; |
|
| 4367 | + |
|
| 4368 | + $neighbourhood_info = geodir_location_insert_update_neighbourhood($hood_data); |
|
| 4369 | + if (!empty($neighbourhood_info) && isset($neighbourhood_info->hood_slug)) {
|
|
| 4370 | + $gd_post['post_neighbourhood'] = $neighbourhood_info->hood_slug; |
|
| 4371 | + } |
|
| 4372 | + } |
|
| 4373 | + } |
|
| 4374 | + $gd_post['post_location_id'] = $post_location_id; |
|
| 4375 | 4375 | |
| 4376 | - // post package info |
|
| 4377 | - $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0; |
|
| 4378 | - if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
|
|
| 4379 | - $package_id = $gd_post_info->package_id; |
|
| 4380 | - } |
|
| 4376 | + // post package info |
|
| 4377 | + $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0; |
|
| 4378 | + if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
|
|
| 4379 | + $package_id = $gd_post_info->package_id; |
|
| 4380 | + } |
|
| 4381 | 4381 | |
| 4382 | - $package_info = array(); |
|
| 4383 | - if ($package_id && function_exists('geodir_get_package_info_by_id')) {
|
|
| 4384 | - $package_info = (array)geodir_get_package_info_by_id($package_id); |
|
| 4382 | + $package_info = array(); |
|
| 4383 | + if ($package_id && function_exists('geodir_get_package_info_by_id')) {
|
|
| 4384 | + $package_info = (array)geodir_get_package_info_by_id($package_id); |
|
| 4385 | 4385 | |
| 4386 | - if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
|
|
| 4387 | - $package_info = array(); |
|
| 4388 | - } |
|
| 4389 | - } |
|
| 4386 | + if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
|
|
| 4387 | + $package_info = array(); |
|
| 4388 | + } |
|
| 4389 | + } |
|
| 4390 | 4390 | |
| 4391 | - if (empty($package_info)) {
|
|
| 4392 | - $package_info = (array)geodir_post_package_info( array(), '', $post_type ); |
|
| 4393 | - } |
|
| 4391 | + if (empty($package_info)) {
|
|
| 4392 | + $package_info = (array)geodir_post_package_info( array(), '', $post_type ); |
|
| 4393 | + } |
|
| 4394 | 4394 | |
| 4395 | - if (!empty($package_info)) {
|
|
| 4396 | - $package_id = $package_info['pid']; |
|
| 4395 | + if (!empty($package_info)) {
|
|
| 4396 | + $package_id = $package_info['pid']; |
|
| 4397 | 4397 | |
| 4398 | - if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
|
|
| 4399 | - $gd_post['expire_date'] = $expire_date; |
|
| 4400 | - } else {
|
|
| 4401 | - if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) {
|
|
| 4402 | - $gd_post['alive_days'] = (int)$package_info['days']; |
|
| 4403 | - $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) ); |
|
| 4404 | - } else {
|
|
| 4405 | - $gd_post['expire_date'] = 'Never'; |
|
| 4406 | - } |
|
| 4407 | - } |
|
| 4398 | + if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
|
|
| 4399 | + $gd_post['expire_date'] = $expire_date; |
|
| 4400 | + } else {
|
|
| 4401 | + if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) {
|
|
| 4402 | + $gd_post['alive_days'] = (int)$package_info['days']; |
|
| 4403 | + $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) ); |
|
| 4404 | + } else {
|
|
| 4405 | + $gd_post['expire_date'] = 'Never'; |
|
| 4406 | + } |
|
| 4407 | + } |
|
| 4408 | 4408 | |
| 4409 | - $gd_post['package_id'] = $package_id; |
|
| 4410 | - } |
|
| 4409 | + $gd_post['package_id'] = $package_id; |
|
| 4410 | + } |
|
| 4411 | 4411 | |
| 4412 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 4412 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 4413 | 4413 | |
| 4414 | - if ($post_type == 'gd_event') {
|
|
| 4415 | - $gd_post = geodir_imex_process_event_data($gd_post); |
|
| 4416 | - } |
|
| 4414 | + if ($post_type == 'gd_event') {
|
|
| 4415 | + $gd_post = geodir_imex_process_event_data($gd_post); |
|
| 4416 | + } |
|
| 4417 | 4417 | |
| 4418 | - if (isset($gd_post['post_id'])) {
|
|
| 4419 | - unset($gd_post['post_id']); |
|
| 4420 | - } |
|
| 4418 | + if (isset($gd_post['post_id'])) {
|
|
| 4419 | + unset($gd_post['post_id']); |
|
| 4420 | + } |
|
| 4421 | 4421 | |
| 4422 | - // Export franchise fields |
|
| 4423 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
| 4424 | - if ($is_franchise_active) {
|
|
| 4425 | - if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
|
|
| 4426 | - $gd_franchise_lock = array(); |
|
| 4422 | + // Export franchise fields |
|
| 4423 | + $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
| 4424 | + if ($is_franchise_active) {
|
|
| 4425 | + if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
|
|
| 4426 | + $gd_franchise_lock = array(); |
|
| 4427 | 4427 | |
| 4428 | - if ( isset( $gd_post['gd_franchise_lock'] ) ) {
|
|
| 4429 | - $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] );
|
|
| 4430 | - $gd_franchise_lock = trim( $gd_franchise_lock ); |
|
| 4431 | - $gd_franchise_lock = explode( ",", $gd_franchise_lock ); |
|
| 4432 | - } |
|
| 4428 | + if ( isset( $gd_post['gd_franchise_lock'] ) ) {
|
|
| 4429 | + $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] );
|
|
| 4430 | + $gd_franchise_lock = trim( $gd_franchise_lock ); |
|
| 4431 | + $gd_franchise_lock = explode( ",", $gd_franchise_lock ); |
|
| 4432 | + } |
|
| 4433 | 4433 | |
| 4434 | - update_post_meta( $saved_post_id, 'gd_is_franchise', 1 ); |
|
| 4435 | - update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock ); |
|
| 4436 | - } else {
|
|
| 4437 | - if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) {
|
|
| 4438 | - geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] ); |
|
| 4439 | - } |
|
| 4440 | - } |
|
| 4441 | - } |
|
| 4434 | + update_post_meta( $saved_post_id, 'gd_is_franchise', 1 ); |
|
| 4435 | + update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock ); |
|
| 4436 | + } else {
|
|
| 4437 | + if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) {
|
|
| 4438 | + geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] ); |
|
| 4439 | + } |
|
| 4440 | + } |
|
| 4441 | + } |
|
| 4442 | 4442 | |
| 4443 | - if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) {
|
|
| 4444 | - $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) ); |
|
| 4445 | - if ($default_category_id) {
|
|
| 4446 | - $save_post['post_default_category'] = $default_category_id; |
|
| 4447 | - $gd_post['default_category'] = $default_category_id; |
|
| 4448 | - } |
|
| 4449 | - $gd_post[$cat_taxonomy] = $save_post['post_category']; |
|
| 4450 | - } |
|
| 4443 | + if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) {
|
|
| 4444 | + $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) ); |
|
| 4445 | + if ($default_category_id) {
|
|
| 4446 | + $save_post['post_default_category'] = $default_category_id; |
|
| 4447 | + $gd_post['default_category'] = $default_category_id; |
|
| 4448 | + } |
|
| 4449 | + $gd_post[$cat_taxonomy] = $save_post['post_category']; |
|
| 4450 | + } |
|
| 4451 | 4451 | |
| 4452 | - // Save post info |
|
| 4453 | - geodir_save_post_info( $saved_post_id, $gd_post ); |
|
| 4454 | - // post taxonomies |
|
| 4455 | - if ( !empty( $save_post['post_category'] ) ) {
|
|
| 4456 | - wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy ); |
|
| 4452 | + // Save post info |
|
| 4453 | + geodir_save_post_info( $saved_post_id, $gd_post ); |
|
| 4454 | + // post taxonomies |
|
| 4455 | + if ( !empty( $save_post['post_category'] ) ) {
|
|
| 4456 | + wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy ); |
|
| 4457 | 4457 | |
| 4458 | - $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : ''; |
|
| 4459 | - if ($default_category_id) {
|
|
| 4460 | - $post_default_category = $default_category_id; |
|
| 4461 | - } |
|
| 4462 | - $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy); |
|
| 4463 | - $save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category'];
|
|
| 4464 | - $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : '';
|
|
| 4458 | + $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : ''; |
|
| 4459 | + if ($default_category_id) {
|
|
| 4460 | + $post_default_category = $default_category_id; |
|
| 4461 | + } |
|
| 4462 | + $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy); |
|
| 4463 | + $save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category'];
|
|
| 4464 | + $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : '';
|
|
| 4465 | 4465 | |
| 4466 | - if ($post_category_str != '' && $post_default_category) {
|
|
| 4467 | - $post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str); |
|
| 4468 | - } |
|
| 4466 | + if ($post_category_str != '' && $post_default_category) {
|
|
| 4467 | + $post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str); |
|
| 4468 | + } |
|
| 4469 | 4469 | |
| 4470 | - $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : ''; |
|
| 4470 | + $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : ''; |
|
| 4471 | 4471 | |
| 4472 | - geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str ); |
|
| 4473 | - } |
|
| 4472 | + geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str ); |
|
| 4473 | + } |
|
| 4474 | 4474 | |
| 4475 | - if ( !empty( $save_post['post_tags'] ) ) {
|
|
| 4476 | - wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy ); |
|
| 4477 | - } |
|
| 4475 | + if ( !empty( $save_post['post_tags'] ) ) {
|
|
| 4476 | + wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy ); |
|
| 4477 | + } |
|
| 4478 | 4478 | |
| 4479 | - // Post images |
|
| 4480 | - if ( !empty( $post_images ) ) {
|
|
| 4481 | - $post_images = array_unique($post_images); |
|
| 4479 | + // Post images |
|
| 4480 | + if ( !empty( $post_images ) ) {
|
|
| 4481 | + $post_images = array_unique($post_images); |
|
| 4482 | 4482 | |
| 4483 | - $old_post_images_arr = array(); |
|
| 4484 | - $saved_post_images_arr = array(); |
|
| 4483 | + $old_post_images_arr = array(); |
|
| 4484 | + $saved_post_images_arr = array(); |
|
| 4485 | 4485 | |
| 4486 | - $order = 1; |
|
| 4486 | + $order = 1; |
|
| 4487 | 4487 | |
| 4488 | - $old_post_images = geodir_get_images( $saved_post_id ); |
|
| 4489 | - if (!empty($old_post_images)) {
|
|
| 4490 | - foreach( $old_post_images as $old_post_image ) {
|
|
| 4491 | - if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
|
|
| 4492 | - $old_post_images_arr[] = $old_post_image->file; |
|
| 4493 | - } |
|
| 4494 | - } |
|
| 4495 | - } |
|
| 4488 | + $old_post_images = geodir_get_images( $saved_post_id ); |
|
| 4489 | + if (!empty($old_post_images)) {
|
|
| 4490 | + foreach( $old_post_images as $old_post_image ) {
|
|
| 4491 | + if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
|
|
| 4492 | + $old_post_images_arr[] = $old_post_image->file; |
|
| 4493 | + } |
|
| 4494 | + } |
|
| 4495 | + } |
|
| 4496 | 4496 | |
| 4497 | - foreach ( $post_images as $post_image ) {
|
|
| 4498 | - $image_name = basename( $post_image ); |
|
| 4499 | - $saved_post_images_arr[] = $image_name; |
|
| 4497 | + foreach ( $post_images as $post_image ) {
|
|
| 4498 | + $image_name = basename( $post_image ); |
|
| 4499 | + $saved_post_images_arr[] = $image_name; |
|
| 4500 | 4500 | |
| 4501 | - if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
|
|
| 4502 | - continue; // Skip if image already exists. |
|
| 4503 | - } |
|
| 4501 | + if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
|
|
| 4502 | + continue; // Skip if image already exists. |
|
| 4503 | + } |
|
| 4504 | 4504 | |
| 4505 | - $image_name_parts = explode( '.', $image_name ); |
|
| 4506 | - array_pop( $image_name_parts ); |
|
| 4507 | - $proper_image_name = implode( '.', $image_name_parts ); |
|
| 4505 | + $image_name_parts = explode( '.', $image_name ); |
|
| 4506 | + array_pop( $image_name_parts ); |
|
| 4507 | + $proper_image_name = implode( '.', $image_name_parts ); |
|
| 4508 | 4508 | |
| 4509 | - $arr_file_type = wp_check_filetype( $image_name ); |
|
| 4509 | + $arr_file_type = wp_check_filetype( $image_name ); |
|
| 4510 | 4510 | |
| 4511 | - if ( !empty( $arr_file_type ) ) {
|
|
| 4512 | - $uploaded_file_type = $arr_file_type['type']; |
|
| 4511 | + if ( !empty( $arr_file_type ) ) {
|
|
| 4512 | + $uploaded_file_type = $arr_file_type['type']; |
|
| 4513 | 4513 | |
| 4514 | - $attachment = array(); |
|
| 4515 | - $attachment['post_id'] = $saved_post_id; |
|
| 4516 | - $attachment['title'] = $proper_image_name; |
|
| 4517 | - $attachment['content'] = ''; |
|
| 4518 | - $attachment['file'] = $uploads_subdir . '/' . $image_name; |
|
| 4519 | - $attachment['mime_type'] = $uploaded_file_type; |
|
| 4520 | - $attachment['menu_order'] = $order; |
|
| 4521 | - $attachment['is_featured'] = 0; |
|
| 4522 | - |
|
| 4523 | - $attachment_set = ''; |
|
| 4524 | - foreach ( $attachment as $key => $val ) {
|
|
| 4525 | - if ( $val != '' ) {
|
|
| 4526 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
| 4527 | - } |
|
| 4528 | - } |
|
| 4529 | - $attachment_set = trim( $attachment_set, ", " ); |
|
| 4514 | + $attachment = array(); |
|
| 4515 | + $attachment['post_id'] = $saved_post_id; |
|
| 4516 | + $attachment['title'] = $proper_image_name; |
|
| 4517 | + $attachment['content'] = ''; |
|
| 4518 | + $attachment['file'] = $uploads_subdir . '/' . $image_name; |
|
| 4519 | + $attachment['mime_type'] = $uploaded_file_type; |
|
| 4520 | + $attachment['menu_order'] = $order; |
|
| 4521 | + $attachment['is_featured'] = 0; |
|
| 4522 | + |
|
| 4523 | + $attachment_set = ''; |
|
| 4524 | + foreach ( $attachment as $key => $val ) {
|
|
| 4525 | + if ( $val != '' ) {
|
|
| 4526 | + $attachment_set .= $key . " = '" . $val . "', "; |
|
| 4527 | + } |
|
| 4528 | + } |
|
| 4529 | + $attachment_set = trim( $attachment_set, ", " ); |
|
| 4530 | 4530 | |
| 4531 | - // Add new attachment |
|
| 4532 | - $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set ); |
|
| 4531 | + // Add new attachment |
|
| 4532 | + $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set ); |
|
| 4533 | 4533 | |
| 4534 | - $order++; |
|
| 4535 | - } |
|
| 4536 | - } |
|
| 4534 | + $order++; |
|
| 4535 | + } |
|
| 4536 | + } |
|
| 4537 | 4537 | |
| 4538 | - $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/", $saved_post_images_arr) . "' )" : '';
|
|
| 4539 | - // Remove previous attachment |
|
| 4540 | - $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql ); |
|
| 4538 | + $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/", $saved_post_images_arr) . "' )" : '';
|
|
| 4539 | + // Remove previous attachment |
|
| 4540 | + $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql ); |
|
| 4541 | 4541 | |
| 4542 | - if ( !empty( $saved_post_images_arr ) ) {
|
|
| 4543 | - geodir_set_wp_featured_image($saved_post_id); |
|
| 4544 | - /* |
|
| 4542 | + if ( !empty( $saved_post_images_arr ) ) {
|
|
| 4543 | + geodir_set_wp_featured_image($saved_post_id); |
|
| 4544 | + /* |
|
| 4545 | 4545 | $menu_order = 1; |
| 4546 | 4546 | |
| 4547 | 4547 | foreach ( $saved_post_images_arr as $img_name ) {
|
@@ -4554,281 +4554,281 @@ discard block |
||
| 4554 | 4554 | } |
| 4555 | 4555 | $menu_order++; |
| 4556 | 4556 | }*/ |
| 4557 | - } |
|
| 4557 | + } |
|
| 4558 | 4558 | |
| 4559 | - if ( $order > 1 ) {
|
|
| 4560 | - $images++; |
|
| 4561 | - } |
|
| 4562 | - } |
|
| 4559 | + if ( $order > 1 ) {
|
|
| 4560 | + $images++; |
|
| 4561 | + } |
|
| 4562 | + } |
|
| 4563 | 4563 | |
| 4564 | - /** This action is documented in geodirectory-functions/post-functions.php */ |
|
| 4565 | - do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post ); |
|
| 4564 | + /** This action is documented in geodirectory-functions/post-functions.php */ |
|
| 4565 | + do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post ); |
|
| 4566 | 4566 | |
| 4567 | - if (isset($is_featured)) {
|
|
| 4568 | - geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured); |
|
| 4569 | - } |
|
| 4570 | - if (isset($gd_post['expire_date'])) {
|
|
| 4571 | - geodir_save_post_meta($saved_post_id, 'expire_date', $gd_post['expire_date']); |
|
| 4572 | - } |
|
| 4573 | - } |
|
| 4567 | + if (isset($is_featured)) {
|
|
| 4568 | + geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured); |
|
| 4569 | + } |
|
| 4570 | + if (isset($gd_post['expire_date'])) {
|
|
| 4571 | + geodir_save_post_meta($saved_post_id, 'expire_date', $gd_post['expire_date']); |
|
| 4572 | + } |
|
| 4573 | + } |
|
| 4574 | 4574 | |
| 4575 | - // WPML |
|
| 4576 | - if ($is_wpml && $language != '') {
|
|
| 4577 | - $sitepress->switch_lang($active_lang, true); |
|
| 4578 | - } |
|
| 4579 | - // WPML |
|
| 4580 | - } |
|
| 4581 | - } |
|
| 4582 | - } |
|
| 4575 | + // WPML |
|
| 4576 | + if ($is_wpml && $language != '') {
|
|
| 4577 | + $sitepress->switch_lang($active_lang, true); |
|
| 4578 | + } |
|
| 4579 | + // WPML |
|
| 4580 | + } |
|
| 4581 | + } |
|
| 4582 | + } |
|
| 4583 | 4583 | |
| 4584 | - //undo some stuff to make the import quicker |
|
| 4585 | - wp_defer_term_counting( false ); |
|
| 4586 | - wp_defer_comment_counting( false ); |
|
| 4587 | - $wpdb->query( 'COMMIT;' ); |
|
| 4588 | - $wpdb->query( 'SET autocommit = 1;' ); |
|
| 4589 | - |
|
| 4590 | - $json = array(); |
|
| 4591 | - $json['processed'] = $processed_actual; |
|
| 4592 | - $json['created'] = $created; |
|
| 4593 | - $json['updated'] = $updated; |
|
| 4594 | - $json['skipped'] = $skipped; |
|
| 4595 | - $json['invalid'] = $invalid; |
|
| 4596 | - $json['invalid_addr'] = $invalid_addr; |
|
| 4597 | - $json['images'] = $images; |
|
| 4584 | + //undo some stuff to make the import quicker |
|
| 4585 | + wp_defer_term_counting( false ); |
|
| 4586 | + wp_defer_comment_counting( false ); |
|
| 4587 | + $wpdb->query( 'COMMIT;' ); |
|
| 4588 | + $wpdb->query( 'SET autocommit = 1;' ); |
|
| 4589 | + |
|
| 4590 | + $json = array(); |
|
| 4591 | + $json['processed'] = $processed_actual; |
|
| 4592 | + $json['created'] = $created; |
|
| 4593 | + $json['updated'] = $updated; |
|
| 4594 | + $json['skipped'] = $skipped; |
|
| 4595 | + $json['invalid'] = $invalid; |
|
| 4596 | + $json['invalid_addr'] = $invalid_addr; |
|
| 4597 | + $json['images'] = $images; |
|
| 4598 | 4598 | |
| 4599 | - wp_send_json( $json ); |
|
| 4600 | - exit; |
|
| 4601 | - } else if ( $task == 'import_loc' ) {
|
|
| 4602 | - global $gd_post_types; |
|
| 4603 | - $gd_post_types = $post_types; |
|
| 4599 | + wp_send_json( $json ); |
|
| 4600 | + exit; |
|
| 4601 | + } else if ( $task == 'import_loc' ) {
|
|
| 4602 | + global $gd_post_types; |
|
| 4603 | + $gd_post_types = $post_types; |
|
| 4604 | 4604 | |
| 4605 | - if (!empty($file)) {
|
|
| 4606 | - $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 4605 | + if (!empty($file)) {
|
|
| 4606 | + $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 4607 | 4607 | |
| 4608 | - if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 4609 | - $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
|
| 4610 | - wp_send_json( $json ); |
|
| 4611 | - } |
|
| 4608 | + if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 4609 | + $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
|
| 4610 | + wp_send_json( $json ); |
|
| 4611 | + } |
|
| 4612 | 4612 | |
| 4613 | - $gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory');
|
|
| 4614 | - $gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' ); |
|
| 4615 | - for ($i = 1; $i <= $limit; $i++) {
|
|
| 4616 | - $index = $processed + $i; |
|
| 4613 | + $gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory');
|
|
| 4614 | + $gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' ); |
|
| 4615 | + for ($i = 1; $i <= $limit; $i++) {
|
|
| 4616 | + $index = $processed + $i; |
|
| 4617 | 4617 | |
| 4618 | - if (isset($file[$index])) {
|
|
| 4619 | - $row = $file[$index]; |
|
| 4620 | - $row = array_map( 'trim', $row ); |
|
| 4621 | - $data = array(); |
|
| 4618 | + if (isset($file[$index])) {
|
|
| 4619 | + $row = $file[$index]; |
|
| 4620 | + $row = array_map( 'trim', $row ); |
|
| 4621 | + $data = array(); |
|
| 4622 | 4622 | |
| 4623 | - foreach ($columns as $c => $column ) {
|
|
| 4624 | - if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta_title', 'city_meta_desc', 'city_desc', 'region_meta_title', 'region_meta_desc', 'region_desc', 'country_meta_title', 'country_meta_desc', 'country_desc'))) {
|
|
| 4625 | - $data[$column] = $row[$c]; |
|
| 4626 | - } |
|
| 4627 | - } |
|
| 4623 | + foreach ($columns as $c => $column ) {
|
|
| 4624 | + if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta_title', 'city_meta_desc', 'city_desc', 'region_meta_title', 'region_meta_desc', 'region_desc', 'country_meta_title', 'country_meta_desc', 'country_desc'))) {
|
|
| 4625 | + $data[$column] = $row[$c]; |
|
| 4626 | + } |
|
| 4627 | + } |
|
| 4628 | 4628 | |
| 4629 | - if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
|
|
| 4630 | - $invalid++; |
|
| 4631 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4632 | - continue; |
|
| 4633 | - } |
|
| 4629 | + if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
|
|
| 4630 | + $invalid++; |
|
| 4631 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4632 | + continue; |
|
| 4633 | + } |
|
| 4634 | 4634 | |
| 4635 | - $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0; |
|
| 4635 | + $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0; |
|
| 4636 | 4636 | |
| 4637 | - if ( $import_choice == 'update' ) {
|
|
| 4638 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 4639 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 4640 | - $updated++; |
|
| 4641 | - } else {
|
|
| 4642 | - $invalid++; |
|
| 4643 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4644 | - } |
|
| 4645 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 4646 | - $data['location_id'] = (int)$location->location_id; |
|
| 4637 | + if ( $import_choice == 'update' ) {
|
|
| 4638 | + if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 4639 | + if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 4640 | + $updated++; |
|
| 4641 | + } else {
|
|
| 4642 | + $invalid++; |
|
| 4643 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4644 | + } |
|
| 4645 | + } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 4646 | + $data['location_id'] = (int)$location->location_id; |
|
| 4647 | 4647 | |
| 4648 | - if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) {
|
|
| 4649 | - $data['location_id'] = (int)$location->location_id; |
|
| 4650 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) {
|
|
| 4651 | - $data['location_id'] = (int)$location->location_id; |
|
| 4652 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) {
|
|
| 4653 | - $data['location_id'] = (int)$location->location_id; |
|
| 4654 | - } |
|
| 4648 | + if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) {
|
|
| 4649 | + $data['location_id'] = (int)$location->location_id; |
|
| 4650 | + } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) {
|
|
| 4651 | + $data['location_id'] = (int)$location->location_id; |
|
| 4652 | + } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) {
|
|
| 4653 | + $data['location_id'] = (int)$location->location_id; |
|
| 4654 | + } |
|
| 4655 | 4655 | |
| 4656 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 4657 | - $updated++; |
|
| 4658 | - } else {
|
|
| 4659 | - $invalid++; |
|
| 4660 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4661 | - } |
|
| 4662 | - } else {
|
|
| 4663 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 4664 | - $created++; |
|
| 4665 | - } else {
|
|
| 4666 | - $invalid++; |
|
| 4667 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4668 | - } |
|
| 4669 | - } |
|
| 4670 | - } elseif ( $import_choice == 'skip' ) {
|
|
| 4671 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 4672 | - $skipped++; |
|
| 4673 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 4674 | - $skipped++; |
|
| 4675 | - } else {
|
|
| 4676 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 4677 | - $created++; |
|
| 4678 | - } else {
|
|
| 4679 | - $invalid++; |
|
| 4680 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4681 | - } |
|
| 4682 | - } |
|
| 4683 | - } else {
|
|
| 4684 | - $invalid++; |
|
| 4685 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4686 | - } |
|
| 4687 | - } |
|
| 4688 | - } |
|
| 4689 | - } |
|
| 4656 | + if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 4657 | + $updated++; |
|
| 4658 | + } else {
|
|
| 4659 | + $invalid++; |
|
| 4660 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4661 | + } |
|
| 4662 | + } else {
|
|
| 4663 | + if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 4664 | + $created++; |
|
| 4665 | + } else {
|
|
| 4666 | + $invalid++; |
|
| 4667 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4668 | + } |
|
| 4669 | + } |
|
| 4670 | + } elseif ( $import_choice == 'skip' ) {
|
|
| 4671 | + if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 4672 | + $skipped++; |
|
| 4673 | + } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 4674 | + $skipped++; |
|
| 4675 | + } else {
|
|
| 4676 | + if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 4677 | + $created++; |
|
| 4678 | + } else {
|
|
| 4679 | + $invalid++; |
|
| 4680 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4681 | + } |
|
| 4682 | + } |
|
| 4683 | + } else {
|
|
| 4684 | + $invalid++; |
|
| 4685 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4686 | + } |
|
| 4687 | + } |
|
| 4688 | + } |
|
| 4689 | + } |
|
| 4690 | 4690 | |
| 4691 | - $json = array(); |
|
| 4692 | - $json['processed'] = $limit; |
|
| 4693 | - $json['created'] = $created; |
|
| 4694 | - $json['updated'] = $updated; |
|
| 4695 | - $json['skipped'] = $skipped; |
|
| 4696 | - $json['invalid'] = $invalid; |
|
| 4697 | - $json['images'] = $images; |
|
| 4691 | + $json = array(); |
|
| 4692 | + $json['processed'] = $limit; |
|
| 4693 | + $json['created'] = $created; |
|
| 4694 | + $json['updated'] = $updated; |
|
| 4695 | + $json['skipped'] = $skipped; |
|
| 4696 | + $json['invalid'] = $invalid; |
|
| 4697 | + $json['images'] = $images; |
|
| 4698 | 4698 | |
| 4699 | - wp_send_json( $json ); |
|
| 4700 | - } else if ( $task == 'import_hood' ) {
|
|
| 4701 | - if (!empty($file)) {
|
|
| 4702 | - $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 4699 | + wp_send_json( $json ); |
|
| 4700 | + } else if ( $task == 'import_hood' ) {
|
|
| 4701 | + if (!empty($file)) {
|
|
| 4702 | + $columns = isset($file[0]) ? $file[0] : NULL; |
|
| 4703 | 4703 | |
| 4704 | - if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 4705 | - $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
|
| 4706 | - wp_send_json( $json ); |
|
| 4707 | - } |
|
| 4704 | + if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
|
| 4705 | + $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
|
| 4706 | + wp_send_json( $json ); |
|
| 4707 | + } |
|
| 4708 | 4708 | |
| 4709 | - $gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory');
|
|
| 4710 | - $gd_error_hood = __( 'Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' ); |
|
| 4711 | - for ($i = 1; $i <= $limit; $i++) {
|
|
| 4712 | - $index = $processed + $i; |
|
| 4709 | + $gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory');
|
|
| 4710 | + $gd_error_hood = __( 'Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' ); |
|
| 4711 | + for ($i = 1; $i <= $limit; $i++) {
|
|
| 4712 | + $index = $processed + $i; |
|
| 4713 | 4713 | |
| 4714 | - if (isset($file[$index])) {
|
|
| 4715 | - $row = $file[$index]; |
|
| 4716 | - $row = array_map( 'trim', $row ); |
|
| 4717 | - $data = array(); |
|
| 4714 | + if (isset($file[$index])) {
|
|
| 4715 | + $row = $file[$index]; |
|
| 4716 | + $row = array_map( 'trim', $row ); |
|
| 4717 | + $data = array(); |
|
| 4718 | 4718 | |
| 4719 | - foreach ($columns as $c => $column) {
|
|
| 4720 | - if (in_array($column, array('neighbourhood_id', 'neighbourhood_name', 'neighbourhood_slug', 'latitude', 'longitude', 'location_id', 'city', 'region', 'country'))) {
|
|
| 4721 | - $data[$column] = sanitize_text_field($row[$c]); |
|
| 4722 | - } |
|
| 4723 | - } |
|
| 4719 | + foreach ($columns as $c => $column) {
|
|
| 4720 | + if (in_array($column, array('neighbourhood_id', 'neighbourhood_name', 'neighbourhood_slug', 'latitude', 'longitude', 'location_id', 'city', 'region', 'country'))) {
|
|
| 4721 | + $data[$column] = sanitize_text_field($row[$c]); |
|
| 4722 | + } |
|
| 4723 | + } |
|
| 4724 | 4724 | |
| 4725 | - if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) {
|
|
| 4726 | - $invalid++; |
|
| 4727 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4728 | - continue; |
|
| 4729 | - } |
|
| 4725 | + if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) {
|
|
| 4726 | + $invalid++; |
|
| 4727 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4728 | + continue; |
|
| 4729 | + } |
|
| 4730 | 4730 | |
| 4731 | - $location_info = array(); |
|
| 4732 | - if (!empty($data['location_id']) && (int)$data['location_id'] > 0) {
|
|
| 4733 | - $location_info = geodir_get_location_by_id('', (int)$data['location_id']);
|
|
| 4734 | - } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) {
|
|
| 4735 | - $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region']));
|
|
| 4736 | - } |
|
| 4731 | + $location_info = array(); |
|
| 4732 | + if (!empty($data['location_id']) && (int)$data['location_id'] > 0) {
|
|
| 4733 | + $location_info = geodir_get_location_by_id('', (int)$data['location_id']);
|
|
| 4734 | + } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) {
|
|
| 4735 | + $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region']));
|
|
| 4736 | + } |
|
| 4737 | 4737 | |
| 4738 | - if (empty($location_info)) {
|
|
| 4739 | - $invalid++; |
|
| 4740 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4741 | - continue; |
|
| 4742 | - } |
|
| 4738 | + if (empty($location_info)) {
|
|
| 4739 | + $invalid++; |
|
| 4740 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4741 | + continue; |
|
| 4742 | + } |
|
| 4743 | 4743 | |
| 4744 | - $location_id = $location_info->location_id; |
|
| 4744 | + $location_id = $location_info->location_id; |
|
| 4745 | 4745 | |
| 4746 | - $data['neighbourhood_id'] = isset($data['neighbourhood_id']) ? absint($data['neighbourhood_id']) : 0; |
|
| 4746 | + $data['neighbourhood_id'] = isset($data['neighbourhood_id']) ? absint($data['neighbourhood_id']) : 0; |
|
| 4747 | 4747 | |
| 4748 | - $hood_data = array(); |
|
| 4749 | - $hood_data['hood_name'] = $data['neighbourhood_name']; |
|
| 4750 | - $hood_data['hood_slug'] = $data['neighbourhood_slug']; |
|
| 4751 | - $hood_data['hood_latitude'] = $data['latitude']; |
|
| 4752 | - $hood_data['hood_longitude'] = $data['longitude']; |
|
| 4753 | - $hood_data['hood_location_id'] = $location_id; |
|
| 4748 | + $hood_data = array(); |
|
| 4749 | + $hood_data['hood_name'] = $data['neighbourhood_name']; |
|
| 4750 | + $hood_data['hood_slug'] = $data['neighbourhood_slug']; |
|
| 4751 | + $hood_data['hood_latitude'] = $data['latitude']; |
|
| 4752 | + $hood_data['hood_longitude'] = $data['longitude']; |
|
| 4753 | + $hood_data['hood_location_id'] = $location_id; |
|
| 4754 | 4754 | |
| 4755 | - if ( $import_choice == 'update' ) {
|
|
| 4756 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
|
|
| 4757 | - $hood_data['hood_id'] = (int)$data['neighbourhood_id']; |
|
| 4755 | + if ( $import_choice == 'update' ) {
|
|
| 4756 | + if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
|
|
| 4757 | + $hood_data['hood_id'] = (int)$data['neighbourhood_id']; |
|
| 4758 | 4758 | |
| 4759 | - if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4760 | - $updated++; |
|
| 4761 | - } else {
|
|
| 4762 | - $invalid++; |
|
| 4763 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4764 | - } |
|
| 4765 | - } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
|
|
| 4766 | - $hood_data['hood_id'] = (int)$neighbourhood->hood_id; |
|
| 4759 | + if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4760 | + $updated++; |
|
| 4761 | + } else {
|
|
| 4762 | + $invalid++; |
|
| 4763 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4764 | + } |
|
| 4765 | + } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
|
|
| 4766 | + $hood_data['hood_id'] = (int)$neighbourhood->hood_id; |
|
| 4767 | 4767 | |
| 4768 | - if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4769 | - $updated++; |
|
| 4770 | - } else {
|
|
| 4771 | - $invalid++; |
|
| 4772 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4773 | - } |
|
| 4774 | - } else {
|
|
| 4775 | - if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4776 | - $created++; |
|
| 4777 | - } else {
|
|
| 4778 | - $invalid++; |
|
| 4779 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4780 | - } |
|
| 4781 | - } |
|
| 4782 | - } elseif ( $import_choice == 'skip' ) {
|
|
| 4783 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
|
|
| 4784 | - $skipped++; |
|
| 4785 | - } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
|
|
| 4786 | - $skipped++; |
|
| 4787 | - } else {
|
|
| 4768 | + if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4769 | + $updated++; |
|
| 4770 | + } else {
|
|
| 4771 | + $invalid++; |
|
| 4772 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4773 | + } |
|
| 4774 | + } else {
|
|
| 4775 | + if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4776 | + $created++; |
|
| 4777 | + } else {
|
|
| 4778 | + $invalid++; |
|
| 4779 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4780 | + } |
|
| 4781 | + } |
|
| 4782 | + } elseif ( $import_choice == 'skip' ) {
|
|
| 4783 | + if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
|
|
| 4784 | + $skipped++; |
|
| 4785 | + } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
|
|
| 4786 | + $skipped++; |
|
| 4787 | + } else {
|
|
| 4788 | 4788 | |
| 4789 | - if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4790 | - $created++; |
|
| 4791 | - } else {
|
|
| 4792 | - $invalid++; |
|
| 4793 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4794 | - } |
|
| 4795 | - } |
|
| 4796 | - } else {
|
|
| 4797 | - $invalid++; |
|
| 4798 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4799 | - } |
|
| 4800 | - } |
|
| 4801 | - } |
|
| 4802 | - } |
|
| 4789 | + if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
|
| 4790 | + $created++; |
|
| 4791 | + } else {
|
|
| 4792 | + $invalid++; |
|
| 4793 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4794 | + } |
|
| 4795 | + } |
|
| 4796 | + } else {
|
|
| 4797 | + $invalid++; |
|
| 4798 | + geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4799 | + } |
|
| 4800 | + } |
|
| 4801 | + } |
|
| 4802 | + } |
|
| 4803 | 4803 | |
| 4804 | - $json = array(); |
|
| 4805 | - $json['processed'] = $limit; |
|
| 4806 | - $json['created'] = $created; |
|
| 4807 | - $json['updated'] = $updated; |
|
| 4808 | - $json['skipped'] = $skipped; |
|
| 4809 | - $json['invalid'] = $invalid; |
|
| 4810 | - $json['images'] = $images; |
|
| 4804 | + $json = array(); |
|
| 4805 | + $json['processed'] = $limit; |
|
| 4806 | + $json['created'] = $created; |
|
| 4807 | + $json['updated'] = $updated; |
|
| 4808 | + $json['skipped'] = $skipped; |
|
| 4809 | + $json['invalid'] = $invalid; |
|
| 4810 | + $json['images'] = $images; |
|
| 4811 | 4811 | |
| 4812 | - wp_send_json( $json ); |
|
| 4813 | - } |
|
| 4814 | - } |
|
| 4815 | - break; |
|
| 4816 | - case 'import_finish':{
|
|
| 4817 | - /** |
|
| 4818 | - * Run an action when an import finishes. |
|
| 4819 | - * |
|
| 4820 | - * This action can be used to fire functions after an import ends. |
|
| 4821 | - * |
|
| 4822 | - * @since 1.5.3 |
|
| 4823 | - * @package GeoDirectory |
|
| 4824 | - */ |
|
| 4825 | - do_action('geodir_import_finished');
|
|
| 4826 | - } |
|
| 4827 | - break; |
|
| 4812 | + wp_send_json( $json ); |
|
| 4813 | + } |
|
| 4814 | + } |
|
| 4815 | + break; |
|
| 4816 | + case 'import_finish':{
|
|
| 4817 | + /** |
|
| 4818 | + * Run an action when an import finishes. |
|
| 4819 | + * |
|
| 4820 | + * This action can be used to fire functions after an import ends. |
|
| 4821 | + * |
|
| 4822 | + * @since 1.5.3 |
|
| 4823 | + * @package GeoDirectory |
|
| 4824 | + */ |
|
| 4825 | + do_action('geodir_import_finished');
|
|
| 4826 | + } |
|
| 4827 | + break; |
|
| 4828 | 4828 | |
| 4829 | - } |
|
| 4830 | - echo '0'; |
|
| 4831 | - gd_die(); |
|
| 4829 | + } |
|
| 4830 | + echo '0'; |
|
| 4831 | + gd_die(); |
|
| 4832 | 4832 | } |
| 4833 | 4833 | |
| 4834 | 4834 | /** |
@@ -4872,12 +4872,12 @@ discard block |
||
| 4872 | 4872 | $args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args ); |
| 4873 | 4873 | } |
| 4874 | 4874 | |
| 4875 | - if( !empty( $term ) ) {
|
|
| 4875 | + if( !empty( $term ) ) {
|
|
| 4876 | 4876 | $result = wp_insert_term( $term, $taxonomy, $args ); |
| 4877 | - if( !is_wp_error( $result ) ) {
|
|
| 4878 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4879 | - } |
|
| 4880 | - } |
|
| 4877 | + if( !is_wp_error( $result ) ) {
|
|
| 4878 | + return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4879 | + } |
|
| 4880 | + } |
|
| 4881 | 4881 | |
| 4882 | 4882 | return false; |
| 4883 | 4883 | } |
@@ -4923,16 +4923,16 @@ discard block |
||
| 4923 | 4923 | $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
| 4924 | 4924 | |
| 4925 | 4925 | if( !is_wp_error( $result ) ) {
|
| 4926 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4927 | - } |
|
| 4926 | + return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4927 | + } |
|
| 4928 | 4928 | } else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
| 4929 | 4929 | $term_data['term_id'] = $term_info['term_id']; |
| 4930 | 4930 | |
| 4931 | 4931 | $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
| 4932 | 4932 | |
| 4933 | 4933 | if( !is_wp_error( $result ) ) {
|
| 4934 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4935 | - } |
|
| 4934 | + return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4935 | + } |
|
| 4936 | 4936 | } else {
|
| 4937 | 4937 | return geodir_imex_insert_term( $taxonomy, $term_data ); |
| 4938 | 4938 | } |
@@ -4954,47 +4954,47 @@ discard block |
||
| 4954 | 4954 | * @return int Posts count. |
| 4955 | 4955 | */ |
| 4956 | 4956 | function geodir_get_posts_count( $post_type ) {
|
| 4957 | - global $wpdb, $plugin_prefix; |
|
| 4957 | + global $wpdb, $plugin_prefix; |
|
| 4958 | 4958 | |
| 4959 | - if ( !post_type_exists( $post_type ) ) {
|
|
| 4960 | - return 0; |
|
| 4961 | - } |
|
| 4959 | + if ( !post_type_exists( $post_type ) ) {
|
|
| 4960 | + return 0; |
|
| 4961 | + } |
|
| 4962 | 4962 | |
| 4963 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 4963 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 4964 | 4964 | |
| 4965 | - // Skip listing with statuses trash, auto-draft etc... |
|
| 4966 | - $skip_statuses = geodir_imex_export_skip_statuses(); |
|
| 4967 | - $where_statuses = ''; |
|
| 4968 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
|
|
| 4969 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
|
|
| 4970 | - } |
|
| 4965 | + // Skip listing with statuses trash, auto-draft etc... |
|
| 4966 | + $skip_statuses = geodir_imex_export_skip_statuses(); |
|
| 4967 | + $where_statuses = ''; |
|
| 4968 | + if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
|
|
| 4969 | + $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
|
|
| 4970 | + } |
|
| 4971 | 4971 | |
| 4972 | - /** |
|
| 4973 | - * Filter the SQL where clause part to filter posts count in import/export. |
|
| 4974 | - * |
|
| 4975 | - * @since 1.6.4 |
|
| 4976 | - * @package GeoDirectory |
|
| 4977 | - * |
|
| 4978 | - * @param string $where SQL where clause part. |
|
| 4979 | - */ |
|
| 4980 | - $where_statuses = apply_filters( 'geodir_get_posts_count', $where_statuses, $post_type ); |
|
| 4981 | - |
|
| 4982 | - $query = $wpdb->prepare( "SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses, $post_type );
|
|
| 4983 | - |
|
| 4984 | - $posts_count = (int)$wpdb->get_var( $query ); |
|
| 4972 | + /** |
|
| 4973 | + * Filter the SQL where clause part to filter posts count in import/export. |
|
| 4974 | + * |
|
| 4975 | + * @since 1.6.4 |
|
| 4976 | + * @package GeoDirectory |
|
| 4977 | + * |
|
| 4978 | + * @param string $where SQL where clause part. |
|
| 4979 | + */ |
|
| 4980 | + $where_statuses = apply_filters( 'geodir_get_posts_count', $where_statuses, $post_type ); |
|
| 4981 | + |
|
| 4982 | + $query = $wpdb->prepare( "SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses, $post_type );
|
|
| 4983 | + |
|
| 4984 | + $posts_count = (int)$wpdb->get_var( $query ); |
|
| 4985 | 4985 | |
| 4986 | - /** |
|
| 4987 | - * Modify returned post counts for the current post type. |
|
| 4988 | - * |
|
| 4989 | - * @since 1.4.6 |
|
| 4990 | - * @package GeoDirectory |
|
| 4991 | - * |
|
| 4992 | - * @param int $posts_count Post counts. |
|
| 4993 | - * @param string $post_type Post type. |
|
| 4994 | - */ |
|
| 4995 | - $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type ); |
|
| 4996 | - |
|
| 4997 | - return $posts_count; |
|
| 4986 | + /** |
|
| 4987 | + * Modify returned post counts for the current post type. |
|
| 4988 | + * |
|
| 4989 | + * @since 1.4.6 |
|
| 4990 | + * @package GeoDirectory |
|
| 4991 | + * |
|
| 4992 | + * @param int $posts_count Post counts. |
|
| 4993 | + * @param string $post_type Post type. |
|
| 4994 | + */ |
|
| 4995 | + $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type ); |
|
| 4996 | + |
|
| 4997 | + return $posts_count; |
|
| 4998 | 4998 | } |
| 4999 | 4999 | |
| 5000 | 5000 | /** |
@@ -5022,10 +5022,10 @@ discard block |
||
| 5022 | 5022 | |
| 5023 | 5023 | if ( !empty( $posts ) ) {
|
| 5024 | 5024 | $is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' ); |
| 5025 | - $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
|
|
| 5026 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
| 5027 | - $neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false;
|
|
| 5028 | - $is_claim_active = is_plugin_active( 'geodir_claim_listing/geodir_claim_listing.php' ) && get_option('geodir_claim_enable') === 'yes' ? true : false;
|
|
| 5025 | + $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
|
|
| 5026 | + $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
| 5027 | + $neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false;
|
|
| 5028 | + $is_claim_active = is_plugin_active( 'geodir_claim_listing/geodir_claim_listing.php' ) && get_option('geodir_claim_enable') === 'yes' ? true : false;
|
|
| 5029 | 5029 | |
| 5030 | 5030 | $csv_row = array(); |
| 5031 | 5031 | $csv_row[] = 'post_id'; |
@@ -5057,7 +5057,7 @@ discard block |
||
| 5057 | 5057 | } |
| 5058 | 5058 | $csv_row[] = 'post_status'; |
| 5059 | 5059 | $csv_row[] = 'is_featured'; |
| 5060 | - // Export claim listing field |
|
| 5060 | + // Export claim listing field |
|
| 5061 | 5061 | if ($is_claim_active) {
|
| 5062 | 5062 | $csv_row[] = 'claimed'; |
| 5063 | 5063 | } |
@@ -5065,7 +5065,7 @@ discard block |
||
| 5065 | 5065 | $csv_row[] = 'package_id'; |
| 5066 | 5066 | $csv_row[] = 'expire_date'; |
| 5067 | 5067 | } |
| 5068 | - $csv_row[] = 'post_date'; |
|
| 5068 | + $csv_row[] = 'post_date'; |
|
| 5069 | 5069 | $csv_row[] = 'post_address'; |
| 5070 | 5070 | $csv_row[] = 'post_city'; |
| 5071 | 5071 | $csv_row[] = 'post_region'; |
@@ -5073,11 +5073,11 @@ discard block |
||
| 5073 | 5073 | $csv_row[] = 'post_zip'; |
| 5074 | 5074 | $csv_row[] = 'post_latitude'; |
| 5075 | 5075 | $csv_row[] = 'post_longitude'; |
| 5076 | - if ($neighbourhood_active) {
|
|
| 5077 | - $csv_row[] = 'post_neighbourhood'; |
|
| 5078 | - $csv_row[] = 'neighbourhood_latitude'; |
|
| 5079 | - $csv_row[] = 'neighbourhood_longitude'; |
|
| 5080 | - } |
|
| 5076 | + if ($neighbourhood_active) {
|
|
| 5077 | + $csv_row[] = 'post_neighbourhood'; |
|
| 5078 | + $csv_row[] = 'neighbourhood_latitude'; |
|
| 5079 | + $csv_row[] = 'neighbourhood_longitude'; |
|
| 5080 | + } |
|
| 5081 | 5081 | $csv_row[] = 'geodir_timing'; |
| 5082 | 5082 | $csv_row[] = 'geodir_contact'; |
| 5083 | 5083 | $csv_row[] = 'geodir_email'; |
@@ -5109,21 +5109,21 @@ discard block |
||
| 5109 | 5109 | $csv_row[] = 'franchise'; |
| 5110 | 5110 | } |
| 5111 | 5111 | |
| 5112 | - /** |
|
| 5113 | - * Filter columns field names of gd export listings csv. |
|
| 5114 | - * |
|
| 5115 | - * @since 1.6.5 |
|
| 5116 | - * @package GeoDirectory |
|
| 5117 | - * |
|
| 5118 | - * @param array $csv_row Column names being exported in csv. |
|
| 5119 | - * @param string $post_type The post type. |
|
| 5120 | - */ |
|
| 5121 | - $csv_row = apply_filters('geodir_export_listing_csv_column_names', $csv_row, $post_type);
|
|
| 5112 | + /** |
|
| 5113 | + * Filter columns field names of gd export listings csv. |
|
| 5114 | + * |
|
| 5115 | + * @since 1.6.5 |
|
| 5116 | + * @package GeoDirectory |
|
| 5117 | + * |
|
| 5118 | + * @param array $csv_row Column names being exported in csv. |
|
| 5119 | + * @param string $post_type The post type. |
|
| 5120 | + */ |
|
| 5121 | + $csv_row = apply_filters('geodir_export_listing_csv_column_names', $csv_row, $post_type);
|
|
| 5122 | 5122 | |
| 5123 | 5123 | $csv_rows[] = $csv_row; |
| 5124 | 5124 | |
| 5125 | 5125 | $images_count = 5; |
| 5126 | - $xx=0; |
|
| 5126 | + $xx=0; |
|
| 5127 | 5127 | foreach ( $posts as $post ) {$xx++;
|
| 5128 | 5128 | $post_id = $post['ID']; |
| 5129 | 5129 | |
@@ -5254,14 +5254,14 @@ discard block |
||
| 5254 | 5254 | } |
| 5255 | 5255 | $csv_row[] = $post_info['post_status']; // post_status |
| 5256 | 5256 | $csv_row[] = (int)$post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
| 5257 | - if ($is_claim_active) {
|
|
| 5258 | - $csv_row[] = !empty($post_info['claimed']) && (int)$post_info['claimed'] == 1 ? 1 : ''; // claimed |
|
| 5259 | - } |
|
| 5257 | + if ($is_claim_active) {
|
|
| 5258 | + $csv_row[] = !empty($post_info['claimed']) && (int)$post_info['claimed'] == 1 ? 1 : ''; // claimed |
|
| 5259 | + } |
|
| 5260 | 5260 | if ($is_payment_plugin) {
|
| 5261 | 5261 | $csv_row[] = (int)$post_info['package_id']; // package_id |
| 5262 | 5262 | $csv_row[] = $post_info['expire_date'] != '' && geodir_strtolower($post_info['expire_date']) != 'never' ? date_i18n('Y-m-d', strtotime($post_info['expire_date'])) : 'Never'; // expire_date
|
| 5263 | 5263 | } |
| 5264 | - $csv_row[] = $post_info['post_date']; // post_date |
|
| 5264 | + $csv_row[] = $post_info['post_date']; // post_date |
|
| 5265 | 5265 | $csv_row[] = $post_info['post_address']; // post_address |
| 5266 | 5266 | $csv_row[] = $post_info['post_city']; // post_city |
| 5267 | 5267 | $csv_row[] = $post_info['post_region']; // post_region |
@@ -5269,21 +5269,21 @@ discard block |
||
| 5269 | 5269 | $csv_row[] = $post_info['post_zip']; // post_zip |
| 5270 | 5270 | $csv_row[] = $post_info['post_latitude']; // post_latitude |
| 5271 | 5271 | $csv_row[] = $post_info['post_longitude']; // post_longitude |
| 5272 | - if ($neighbourhood_active) {
|
|
| 5273 | - $post_neighbourhood = ''; |
|
| 5274 | - $neighbourhood_latitude = ''; |
|
| 5275 | - $neighbourhood_longitude = ''; |
|
| 5276 | - if (!empty($post_info['post_neighbourhood']) && ($hood_info = geodir_location_get_neighbourhood_by_id($post_info['post_neighbourhood'], true, $post_info['post_location_id']))) {
|
|
| 5277 | - if (!empty($hood_info)) {
|
|
| 5278 | - $post_neighbourhood = $hood_info->hood_name; |
|
| 5279 | - $neighbourhood_latitude = $hood_info->hood_latitude; |
|
| 5280 | - $neighbourhood_longitude = $hood_info->hood_longitude; |
|
| 5281 | - } |
|
| 5282 | - } |
|
| 5283 | - $csv_row[] = $post_neighbourhood; // post_neighbourhood |
|
| 5284 | - $csv_row[] = $neighbourhood_latitude; // neighbourhood_latitude |
|
| 5285 | - $csv_row[] = $neighbourhood_longitude; // neighbourhood_longitude |
|
| 5286 | - } |
|
| 5272 | + if ($neighbourhood_active) {
|
|
| 5273 | + $post_neighbourhood = ''; |
|
| 5274 | + $neighbourhood_latitude = ''; |
|
| 5275 | + $neighbourhood_longitude = ''; |
|
| 5276 | + if (!empty($post_info['post_neighbourhood']) && ($hood_info = geodir_location_get_neighbourhood_by_id($post_info['post_neighbourhood'], true, $post_info['post_location_id']))) {
|
|
| 5277 | + if (!empty($hood_info)) {
|
|
| 5278 | + $post_neighbourhood = $hood_info->hood_name; |
|
| 5279 | + $neighbourhood_latitude = $hood_info->hood_latitude; |
|
| 5280 | + $neighbourhood_longitude = $hood_info->hood_longitude; |
|
| 5281 | + } |
|
| 5282 | + } |
|
| 5283 | + $csv_row[] = $post_neighbourhood; // post_neighbourhood |
|
| 5284 | + $csv_row[] = $neighbourhood_latitude; // neighbourhood_latitude |
|
| 5285 | + $csv_row[] = $neighbourhood_longitude; // neighbourhood_longitude |
|
| 5286 | + } |
|
| 5287 | 5287 | $csv_row[] = $post_info['geodir_timing']; // geodir_timing |
| 5288 | 5288 | $csv_row[] = $post_info['geodir_contact']; // geodir_contact |
| 5289 | 5289 | $csv_row[] = $post_info['geodir_email']; // geodir_email |
@@ -5323,16 +5323,16 @@ discard block |
||
| 5323 | 5323 | $csv_row[] = (int)$franchise; // franchise id |
| 5324 | 5324 | } |
| 5325 | 5325 | |
| 5326 | - /** |
|
| 5327 | - * Filter columns values of gd export listings csv file |
|
| 5328 | - * |
|
| 5329 | - * @since 1.6.5 |
|
| 5330 | - * @package GeoDirectory |
|
| 5331 | - * |
|
| 5332 | - * @param array $csv_row Field values being exported in csv. |
|
| 5333 | - * @param array $post_info The post info. |
|
| 5334 | - */ |
|
| 5335 | - $csv_row = apply_filters('geodir_export_listing_csv_column_values', $csv_row, $post_info);
|
|
| 5326 | + /** |
|
| 5327 | + * Filter columns values of gd export listings csv file |
|
| 5328 | + * |
|
| 5329 | + * @since 1.6.5 |
|
| 5330 | + * @package GeoDirectory |
|
| 5331 | + * |
|
| 5332 | + * @param array $csv_row Field values being exported in csv. |
|
| 5333 | + * @param array $post_info The post info. |
|
| 5334 | + */ |
|
| 5335 | + $csv_row = apply_filters('geodir_export_listing_csv_column_values', $csv_row, $post_info);
|
|
| 5336 | 5336 | |
| 5337 | 5337 | for ( $c = 0; $c < $images_count; $c++ ) {
|
| 5338 | 5338 | $csv_row[] = isset( $current_images[$c] ) ? $current_images[$c] : ''; // IMAGE |
@@ -5365,64 +5365,64 @@ discard block |
||
| 5365 | 5365 | * @return array Array of posts data. |
| 5366 | 5366 | */ |
| 5367 | 5367 | function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) {
|
| 5368 | - global $wpdb, $plugin_prefix; |
|
| 5368 | + global $wpdb, $plugin_prefix; |
|
| 5369 | 5369 | |
| 5370 | - if ( ! post_type_exists( $post_type ) ) |
|
| 5371 | - return new stdClass; |
|
| 5370 | + if ( ! post_type_exists( $post_type ) ) |
|
| 5371 | + return new stdClass; |
|
| 5372 | 5372 | |
| 5373 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 5373 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 5374 | 5374 | |
| 5375 | - $limit = ''; |
|
| 5376 | - if ( $per_page > 0 && $page_no > 0 ) {
|
|
| 5377 | - $offset = ( $page_no - 1 ) * $per_page; |
|
| 5375 | + $limit = ''; |
|
| 5376 | + if ( $per_page > 0 && $page_no > 0 ) {
|
|
| 5377 | + $offset = ( $page_no - 1 ) * $per_page; |
|
| 5378 | 5378 | |
| 5379 | - if ( $offset > 0 ) {
|
|
| 5380 | - $limit = " LIMIT " . $offset . "," . $per_page; |
|
| 5381 | - } else {
|
|
| 5382 | - $limit = " LIMIT " . $per_page; |
|
| 5383 | - } |
|
| 5384 | - } |
|
| 5379 | + if ( $offset > 0 ) {
|
|
| 5380 | + $limit = " LIMIT " . $offset . "," . $per_page; |
|
| 5381 | + } else {
|
|
| 5382 | + $limit = " LIMIT " . $per_page; |
|
| 5383 | + } |
|
| 5384 | + } |
|
| 5385 | 5385 | |
| 5386 | - // Skip listing with statuses trash, auto-draft etc... |
|
| 5387 | - $skip_statuses = geodir_imex_export_skip_statuses(); |
|
| 5388 | - $where_statuses = ''; |
|
| 5389 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
|
|
| 5390 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
|
|
| 5391 | - } |
|
| 5386 | + // Skip listing with statuses trash, auto-draft etc... |
|
| 5387 | + $skip_statuses = geodir_imex_export_skip_statuses(); |
|
| 5388 | + $where_statuses = ''; |
|
| 5389 | + if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
|
|
| 5390 | + $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
|
|
| 5391 | + } |
|
| 5392 | 5392 | |
| 5393 | - /** |
|
| 5394 | - * Filter the SQL where clause part to filter posts in import/export. |
|
| 5395 | - * |
|
| 5396 | - * @since 1.6.4 |
|
| 5397 | - * @package GeoDirectory |
|
| 5398 | - * |
|
| 5399 | - * @param string $where SQL where clause part. |
|
| 5400 | - */ |
|
| 5401 | - $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
| 5402 | - |
|
| 5403 | - $query = $wpdb->prepare( "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " ORDER BY {$wpdb->posts}.ID ASC" . $limit, $post_type );
|
|
| 5404 | - /** |
|
| 5405 | - * Modify returned posts SQL query for the current post type. |
|
| 5406 | - * |
|
| 5407 | - * @since 1.4.6 |
|
| 5408 | - * @package GeoDirectory |
|
| 5409 | - * |
|
| 5410 | - * @param int $query The SQL query. |
|
| 5411 | - * @param string $post_type Post type. |
|
| 5412 | - */ |
|
| 5413 | - $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type ); |
|
| 5414 | - $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A ); |
|
| 5415 | - |
|
| 5416 | - /** |
|
| 5417 | - * Modify returned post results for the current post type. |
|
| 5418 | - * |
|
| 5419 | - * @since 1.4.6 |
|
| 5420 | - * @package GeoDirectory |
|
| 5421 | - * |
|
| 5422 | - * @param object $results An object containing all post ids. |
|
| 5423 | - * @param string $post_type Post type. |
|
| 5424 | - */ |
|
| 5425 | - return apply_filters( 'geodir_export_posts', $results, $post_type ); |
|
| 5393 | + /** |
|
| 5394 | + * Filter the SQL where clause part to filter posts in import/export. |
|
| 5395 | + * |
|
| 5396 | + * @since 1.6.4 |
|
| 5397 | + * @package GeoDirectory |
|
| 5398 | + * |
|
| 5399 | + * @param string $where SQL where clause part. |
|
| 5400 | + */ |
|
| 5401 | + $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
| 5402 | + |
|
| 5403 | + $query = $wpdb->prepare( "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " ORDER BY {$wpdb->posts}.ID ASC" . $limit, $post_type );
|
|
| 5404 | + /** |
|
| 5405 | + * Modify returned posts SQL query for the current post type. |
|
| 5406 | + * |
|
| 5407 | + * @since 1.4.6 |
|
| 5408 | + * @package GeoDirectory |
|
| 5409 | + * |
|
| 5410 | + * @param int $query The SQL query. |
|
| 5411 | + * @param string $post_type Post type. |
|
| 5412 | + */ |
|
| 5413 | + $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type ); |
|
| 5414 | + $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A ); |
|
| 5415 | + |
|
| 5416 | + /** |
|
| 5417 | + * Modify returned post results for the current post type. |
|
| 5418 | + * |
|
| 5419 | + * @since 1.4.6 |
|
| 5420 | + * @package GeoDirectory |
|
| 5421 | + * |
|
| 5422 | + * @param object $results An object containing all post ids. |
|
| 5423 | + * @param string $post_type Post type. |
|
| 5424 | + */ |
|
| 5425 | + return apply_filters( 'geodir_export_posts', $results, $post_type ); |
|
| 5426 | 5426 | } |
| 5427 | 5427 | |
| 5428 | 5428 | /** |
@@ -5441,26 +5441,26 @@ discard block |
||
| 5441 | 5441 | * @return string The SQL query. |
| 5442 | 5442 | */ |
| 5443 | 5443 | function geodir_imex_get_events_query( $query, $post_type ) {
|
| 5444 | - if ( $post_type == 'gd_event' ) {
|
|
| 5445 | - global $wpdb, $plugin_prefix; |
|
| 5444 | + if ( $post_type == 'gd_event' ) {
|
|
| 5445 | + global $wpdb, $plugin_prefix; |
|
| 5446 | 5446 | |
| 5447 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 5448 | - $schedule_table = EVENT_SCHEDULE; |
|
| 5447 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 5448 | + $schedule_table = EVENT_SCHEDULE; |
|
| 5449 | 5449 | |
| 5450 | - // Skip listing with statuses trash, auto-draft etc... |
|
| 5451 | - $skip_statuses = geodir_imex_export_skip_statuses(); |
|
| 5452 | - $where_statuses = ''; |
|
| 5453 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
|
|
| 5454 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
|
|
| 5455 | - } |
|
| 5450 | + // Skip listing with statuses trash, auto-draft etc... |
|
| 5451 | + $skip_statuses = geodir_imex_export_skip_statuses(); |
|
| 5452 | + $where_statuses = ''; |
|
| 5453 | + if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
|
|
| 5454 | + $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
|
|
| 5455 | + } |
|
| 5456 | 5456 | |
| 5457 | - /** This action is documented in geodirectory-functions/geodirectory-admin/admin_functions.php */ |
|
| 5458 | - $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
| 5457 | + /** This action is documented in geodirectory-functions/geodirectory-admin/admin_functions.php */ |
|
| 5458 | + $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
| 5459 | 5459 | |
| 5460 | - $query = $wpdb->prepare( "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC", $post_type );
|
|
| 5461 | - } |
|
| 5460 | + $query = $wpdb->prepare( "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC", $post_type );
|
|
| 5461 | + } |
|
| 5462 | 5462 | |
| 5463 | - return $query; |
|
| 5463 | + return $query; |
|
| 5464 | 5464 | } |
| 5465 | 5465 | |
| 5466 | 5466 | /** |
@@ -5482,36 +5482,36 @@ discard block |
||
| 5482 | 5482 | * @return int Total terms count. |
| 5483 | 5483 | */ |
| 5484 | 5484 | function geodir_get_terms_count( $post_type ) {
|
| 5485 | - $args = array( 'hide_empty' => 0 ); |
|
| 5485 | + $args = array( 'hide_empty' => 0 ); |
|
| 5486 | 5486 | |
| 5487 | - remove_all_filters( 'get_terms' ); |
|
| 5487 | + remove_all_filters( 'get_terms' ); |
|
| 5488 | 5488 | |
| 5489 | - $taxonomy = $post_type . 'category'; |
|
| 5489 | + $taxonomy = $post_type . 'category'; |
|
| 5490 | 5490 | |
| 5491 | - // WPML |
|
| 5492 | - $is_wpml = geodir_is_wpml(); |
|
| 5493 | - $active_lang = 'all'; |
|
| 5494 | - if ( $is_wpml ) {
|
|
| 5495 | - global $sitepress; |
|
| 5496 | - $active_lang = $sitepress->get_current_language(); |
|
| 5491 | + // WPML |
|
| 5492 | + $is_wpml = geodir_is_wpml(); |
|
| 5493 | + $active_lang = 'all'; |
|
| 5494 | + if ( $is_wpml ) {
|
|
| 5495 | + global $sitepress; |
|
| 5496 | + $active_lang = $sitepress->get_current_language(); |
|
| 5497 | 5497 | |
| 5498 | - if ( $active_lang != 'all' ) {
|
|
| 5499 | - $sitepress->switch_lang( 'all', true ); |
|
| 5500 | - } |
|
| 5501 | - } |
|
| 5502 | - // WPML |
|
| 5498 | + if ( $active_lang != 'all' ) {
|
|
| 5499 | + $sitepress->switch_lang( 'all', true ); |
|
| 5500 | + } |
|
| 5501 | + } |
|
| 5502 | + // WPML |
|
| 5503 | 5503 | |
| 5504 | - $count_terms = wp_count_terms( $taxonomy, $args ); |
|
| 5504 | + $count_terms = wp_count_terms( $taxonomy, $args ); |
|
| 5505 | 5505 | |
| 5506 | - // WPML |
|
| 5507 | - if ( $is_wpml && $active_lang !== 'all' ) {
|
|
| 5508 | - global $sitepress; |
|
| 5509 | - $sitepress->switch_lang( $active_lang, true ); |
|
| 5510 | - } |
|
| 5511 | - // WPML |
|
| 5512 | - $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0; |
|
| 5506 | + // WPML |
|
| 5507 | + if ( $is_wpml && $active_lang !== 'all' ) {
|
|
| 5508 | + global $sitepress; |
|
| 5509 | + $sitepress->switch_lang( $active_lang, true ); |
|
| 5510 | + } |
|
| 5511 | + // WPML |
|
| 5512 | + $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0; |
|
| 5513 | 5513 | |
| 5514 | - return $count_terms; |
|
| 5514 | + return $count_terms; |
|
| 5515 | 5515 | } |
| 5516 | 5516 | |
| 5517 | 5517 | /** |
@@ -5550,11 +5550,11 @@ discard block |
||
| 5550 | 5550 | $csv_row[] = 'cat_posttype'; |
| 5551 | 5551 | $csv_row[] = 'cat_parent'; |
| 5552 | 5552 | $csv_row[] = 'cat_schema'; |
| 5553 | - // WPML |
|
| 5553 | + // WPML |
|
| 5554 | 5554 | $is_wpml = geodir_is_wpml(); |
| 5555 | 5555 | if ($is_wpml) {
|
| 5556 | 5556 | $csv_row[] = 'cat_language'; |
| 5557 | - $csv_row[] = 'cat_id_original'; |
|
| 5557 | + $csv_row[] = 'cat_id_original'; |
|
| 5558 | 5558 | } |
| 5559 | 5559 | // WPML |
| 5560 | 5560 | $csv_row[] = 'cat_description'; |
@@ -5584,10 +5584,10 @@ discard block |
||
| 5584 | 5584 | $csv_row[] = $post_type; |
| 5585 | 5585 | $csv_row[] = $cat_parent; |
| 5586 | 5586 | $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type ); |
| 5587 | - // WPML |
|
| 5587 | + // WPML |
|
| 5588 | 5588 | if ($is_wpml) {
|
| 5589 | 5589 | $csv_row[] = geodir_get_language_for_element( $term->term_id, 'tax_' . $taxonomy ); |
| 5590 | - $csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy ); |
|
| 5590 | + $csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy ); |
|
| 5591 | 5591 | } |
| 5592 | 5592 | // WPML |
| 5593 | 5593 | $csv_row[] = $term->description; |
@@ -6183,43 +6183,43 @@ discard block |
||
| 6183 | 6183 | * @param string $status Post status. |
| 6184 | 6184 | */ |
| 6185 | 6185 | function geodir_create_page($slug, $option, $page_title = '', $page_content = '', $post_parent = 0, $status = 'publish') {
|
| 6186 | - global $wpdb, $current_user; |
|
| 6187 | - |
|
| 6188 | - $option_value = get_option($option); |
|
| 6189 | - |
|
| 6190 | - if ($option_value > 0) : |
|
| 6191 | - if (get_post($option_value)) : |
|
| 6192 | - // Page exists |
|
| 6193 | - return; |
|
| 6194 | - endif; |
|
| 6195 | - endif; |
|
| 6196 | - |
|
| 6197 | - $page_found = $wpdb->get_var( |
|
| 6198 | - $wpdb->prepare( |
|
| 6199 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", |
|
| 6200 | - array($slug) |
|
| 6201 | - ) |
|
| 6202 | - ); |
|
| 6203 | - |
|
| 6204 | - if ($page_found) : |
|
| 6205 | - // Page exists |
|
| 6206 | - if (!$option_value) update_option($option, $page_found); |
|
| 6207 | - return; |
|
| 6208 | - endif; |
|
| 6209 | - |
|
| 6210 | - $page_data = array( |
|
| 6211 | - 'post_status' => $status, |
|
| 6212 | - 'post_type' => 'page', |
|
| 6213 | - 'post_author' => $current_user->ID, |
|
| 6214 | - 'post_name' => $slug, |
|
| 6215 | - 'post_title' => $page_title, |
|
| 6216 | - 'post_content' => $page_content, |
|
| 6217 | - 'post_parent' => $post_parent, |
|
| 6218 | - 'comment_status' => 'closed' |
|
| 6219 | - ); |
|
| 6220 | - $page_id = wp_insert_post($page_data); |
|
| 6221 | - |
|
| 6222 | - add_option($option, $page_id); |
|
| 6186 | + global $wpdb, $current_user; |
|
| 6187 | + |
|
| 6188 | + $option_value = get_option($option); |
|
| 6189 | + |
|
| 6190 | + if ($option_value > 0) : |
|
| 6191 | + if (get_post($option_value)) : |
|
| 6192 | + // Page exists |
|
| 6193 | + return; |
|
| 6194 | + endif; |
|
| 6195 | + endif; |
|
| 6196 | + |
|
| 6197 | + $page_found = $wpdb->get_var( |
|
| 6198 | + $wpdb->prepare( |
|
| 6199 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", |
|
| 6200 | + array($slug) |
|
| 6201 | + ) |
|
| 6202 | + ); |
|
| 6203 | + |
|
| 6204 | + if ($page_found) : |
|
| 6205 | + // Page exists |
|
| 6206 | + if (!$option_value) update_option($option, $page_found); |
|
| 6207 | + return; |
|
| 6208 | + endif; |
|
| 6209 | + |
|
| 6210 | + $page_data = array( |
|
| 6211 | + 'post_status' => $status, |
|
| 6212 | + 'post_type' => 'page', |
|
| 6213 | + 'post_author' => $current_user->ID, |
|
| 6214 | + 'post_name' => $slug, |
|
| 6215 | + 'post_title' => $page_title, |
|
| 6216 | + 'post_content' => $page_content, |
|
| 6217 | + 'post_parent' => $post_parent, |
|
| 6218 | + 'comment_status' => 'closed' |
|
| 6219 | + ); |
|
| 6220 | + $page_id = wp_insert_post($page_data); |
|
| 6221 | + |
|
| 6222 | + add_option($option, $page_id); |
|
| 6223 | 6223 | |
| 6224 | 6224 | } |
| 6225 | 6225 | |
@@ -6250,9 +6250,9 @@ discard block |
||
| 6250 | 6250 | * @package GeoDirectory |
| 6251 | 6251 | */ |
| 6252 | 6252 | function geodir_admin_upgrade_notice() {
|
| 6253 | - $class = "error"; |
|
| 6254 | - $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
|
|
| 6255 | - echo"<div class=\"$class\"> <p>$message</p></div>"; |
|
| 6253 | + $class = "error"; |
|
| 6254 | + $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
|
|
| 6255 | + echo"<div class=\"$class\"> <p>$message</p></div>"; |
|
| 6256 | 6256 | } |
| 6257 | 6257 | |
| 6258 | 6258 | /** |
@@ -6265,18 +6265,18 @@ discard block |
||
| 6265 | 6265 | */ |
| 6266 | 6266 | function geodire_admin_upgrade_notice( $plugin_data, $r ) |
| 6267 | 6267 | {
|
| 6268 | - // readme contents |
|
| 6269 | - $args = array( |
|
| 6270 | - 'timeout' => 15, |
|
| 6271 | - 'redirection' => 5 |
|
| 6272 | - ); |
|
| 6273 | - $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt"; |
|
| 6274 | - $data = wp_remote_get( $url, $args ); |
|
| 6268 | + // readme contents |
|
| 6269 | + $args = array( |
|
| 6270 | + 'timeout' => 15, |
|
| 6271 | + 'redirection' => 5 |
|
| 6272 | + ); |
|
| 6273 | + $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt"; |
|
| 6274 | + $data = wp_remote_get( $url, $args ); |
|
| 6275 | 6275 | |
| 6276 | - if (!is_wp_error($data) && $data['response']['code'] == 200) {
|
|
| 6276 | + if (!is_wp_error($data) && $data['response']['code'] == 200) {
|
|
| 6277 | 6277 | |
| 6278 | - geodir_in_plugin_update_message($data['body']); |
|
| 6279 | - } |
|
| 6278 | + geodir_in_plugin_update_message($data['body']); |
|
| 6279 | + } |
|
| 6280 | 6280 | } |
| 6281 | 6281 | |
| 6282 | 6282 | |
@@ -6284,28 +6284,28 @@ discard block |
||
| 6284 | 6284 | * @param string $content http response body |
| 6285 | 6285 | */ |
| 6286 | 6286 | function geodir_in_plugin_update_message($content) {
|
| 6287 | - // Output Upgrade Notice |
|
| 6288 | - $matches = null; |
|
| 6289 | - $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis'; |
|
| 6290 | - $upgrade_notice = ''; |
|
| 6291 | - if ( preg_match( $regexp, $content, $matches ) ) {
|
|
| 6292 | - if(empty($matches)){return;}
|
|
| 6293 | - |
|
| 6294 | - $version = trim( $matches[1] ); |
|
| 6295 | - if($version && $version>GEODIRECTORY_VERSION){
|
|
| 6296 | - |
|
| 6297 | - |
|
| 6298 | - $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
|
|
| 6299 | - if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) {
|
|
| 6300 | - $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">'; |
|
| 6301 | - foreach ( $notices as $index => $line ) {
|
|
| 6302 | - $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) );
|
|
| 6303 | - } |
|
| 6304 | - $upgrade_notice .= '</div> '; |
|
| 6305 | - } |
|
| 6306 | - } |
|
| 6307 | - } |
|
| 6308 | - echo $upgrade_notice; |
|
| 6287 | + // Output Upgrade Notice |
|
| 6288 | + $matches = null; |
|
| 6289 | + $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis'; |
|
| 6290 | + $upgrade_notice = ''; |
|
| 6291 | + if ( preg_match( $regexp, $content, $matches ) ) {
|
|
| 6292 | + if(empty($matches)){return;}
|
|
| 6293 | + |
|
| 6294 | + $version = trim( $matches[1] ); |
|
| 6295 | + if($version && $version>GEODIRECTORY_VERSION){
|
|
| 6296 | + |
|
| 6297 | + |
|
| 6298 | + $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
|
|
| 6299 | + if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) {
|
|
| 6300 | + $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">'; |
|
| 6301 | + foreach ( $notices as $index => $line ) {
|
|
| 6302 | + $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) );
|
|
| 6303 | + } |
|
| 6304 | + $upgrade_notice .= '</div> '; |
|
| 6305 | + } |
|
| 6306 | + } |
|
| 6307 | + } |
|
| 6308 | + echo $upgrade_notice; |
|
| 6309 | 6309 | } |
| 6310 | 6310 | |
| 6311 | 6311 | /** |
@@ -6338,19 +6338,19 @@ discard block |
||
| 6338 | 6338 | * @param array Listing statuses to be skipped. |
| 6339 | 6339 | */ |
| 6340 | 6340 | function geodir_imex_export_skip_statuses() {
|
| 6341 | - $statuses = array( 'trash', 'auto-draft' ); |
|
| 6341 | + $statuses = array( 'trash', 'auto-draft' ); |
|
| 6342 | 6342 | |
| 6343 | - /** |
|
| 6344 | - * Filter the statuses to skip during GD export listings. |
|
| 6345 | - * |
|
| 6346 | - * @since 1.6.0 |
|
| 6347 | - * @package GeoDirectory |
|
| 6348 | - * |
|
| 6349 | - * @param array $statuses Listing statuses to be skipped. |
|
| 6350 | - */ |
|
| 6351 | - $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses ); |
|
| 6343 | + /** |
|
| 6344 | + * Filter the statuses to skip during GD export listings. |
|
| 6345 | + * |
|
| 6346 | + * @since 1.6.0 |
|
| 6347 | + * @package GeoDirectory |
|
| 6348 | + * |
|
| 6349 | + * @param array $statuses Listing statuses to be skipped. |
|
| 6350 | + */ |
|
| 6351 | + $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses ); |
|
| 6352 | 6352 | |
| 6353 | - return $statuses; |
|
| 6353 | + return $statuses; |
|
| 6354 | 6354 | } |
| 6355 | 6355 | |
| 6356 | 6356 | /** |
@@ -6362,15 +6362,15 @@ discard block |
||
| 6362 | 6362 | * @since 1.6.3 |
| 6363 | 6363 | */ |
| 6364 | 6364 | function geodir_admin_dequeue_scripts() {
|
| 6365 | - // EDD |
|
| 6366 | - if (wp_script_is('jquery-chosen', 'enqueued')) {
|
|
| 6367 | - wp_dequeue_script('jquery-chosen');
|
|
| 6368 | - } |
|
| 6365 | + // EDD |
|
| 6366 | + if (wp_script_is('jquery-chosen', 'enqueued')) {
|
|
| 6367 | + wp_dequeue_script('jquery-chosen');
|
|
| 6368 | + } |
|
| 6369 | 6369 | |
| 6370 | - // Ultimate Addons for Visual Composer |
|
| 6371 | - if (wp_script_is('ultimate-vc-backend-script', 'enqueued')) {
|
|
| 6372 | - wp_dequeue_script('ultimate-vc-backend-script');
|
|
| 6373 | - } |
|
| 6370 | + // Ultimate Addons for Visual Composer |
|
| 6371 | + if (wp_script_is('ultimate-vc-backend-script', 'enqueued')) {
|
|
| 6372 | + wp_dequeue_script('ultimate-vc-backend-script');
|
|
| 6373 | + } |
|
| 6374 | 6374 | } |
| 6375 | 6375 | |
| 6376 | 6376 | /** |
@@ -6386,48 +6386,48 @@ discard block |
||
| 6386 | 6386 | * @return string SQL where clause part. |
| 6387 | 6387 | */ |
| 6388 | 6388 | function geodir_imex_get_filter_where($where = '', $post_type = '') {
|
| 6389 | - global $wpdb; |
|
| 6389 | + global $wpdb; |
|
| 6390 | 6390 | |
| 6391 | - $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
| 6391 | + $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
| 6392 | 6392 | |
| 6393 | - if ( !empty( $filters ) ) {
|
|
| 6394 | - foreach ( $filters as $field => $value ) {
|
|
| 6395 | - switch ($field) {
|
|
| 6396 | - case 'start_date': |
|
| 6397 | - $where .= " AND `" . $wpdb->posts . "`.`post_date` >= '" . sanitize_text_field( $value ) . " 00:00:00'"; |
|
| 6398 | - break; |
|
| 6399 | - case 'end_date': |
|
| 6400 | - $where .= " AND `" . $wpdb->posts . "`.`post_date` <= '" . sanitize_text_field( $value ) . " 23:59:59'"; |
|
| 6401 | - break; |
|
| 6402 | - } |
|
| 6403 | - } |
|
| 6404 | - } |
|
| 6393 | + if ( !empty( $filters ) ) {
|
|
| 6394 | + foreach ( $filters as $field => $value ) {
|
|
| 6395 | + switch ($field) {
|
|
| 6396 | + case 'start_date': |
|
| 6397 | + $where .= " AND `" . $wpdb->posts . "`.`post_date` >= '" . sanitize_text_field( $value ) . " 00:00:00'"; |
|
| 6398 | + break; |
|
| 6399 | + case 'end_date': |
|
| 6400 | + $where .= " AND `" . $wpdb->posts . "`.`post_date` <= '" . sanitize_text_field( $value ) . " 23:59:59'"; |
|
| 6401 | + break; |
|
| 6402 | + } |
|
| 6403 | + } |
|
| 6404 | + } |
|
| 6405 | 6405 | |
| 6406 | - return $where; |
|
| 6406 | + return $where; |
|
| 6407 | 6407 | } |
| 6408 | 6408 | add_filter('geodir_get_posts_count', 'geodir_imex_get_filter_where', 10, 2);
|
| 6409 | 6409 | add_filter('geodir_get_export_posts', 'geodir_imex_get_filter_where', 10, 2);
|
| 6410 | 6410 | |
| 6411 | 6411 | |
| 6412 | 6412 | function geodir_fix_for_primer_theme(){
|
| 6413 | - if(!defined( 'PRIMER_VERSION' )){return;}
|
|
| 6414 | - global $pagenow; |
|
| 6413 | + if(!defined( 'PRIMER_VERSION' )){return;}
|
|
| 6414 | + global $pagenow; |
|
| 6415 | 6415 | |
| 6416 | - if ( ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) && (isset($_REQUEST['post_type']) || isset($_REQUEST['post']) ) ){
|
|
| 6416 | + if ( ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) && (isset($_REQUEST['post_type']) || isset($_REQUEST['post']) ) ){
|
|
| 6417 | 6417 | |
| 6418 | - $post_type = isset($_REQUEST['post_type']) ? esc_attr($_REQUEST['post_type']) : get_post_type( $_GET['post'] ); |
|
| 6418 | + $post_type = isset($_REQUEST['post_type']) ? esc_attr($_REQUEST['post_type']) : get_post_type( $_GET['post'] ); |
|
| 6419 | 6419 | |
| 6420 | - $post_types = geodir_get_posttypes(); |
|
| 6421 | - if ($post_type && in_array($post_type, $post_types) ) {
|
|
| 6422 | - global $primer_customizer_layouts; |
|
| 6423 | - remove_action( 'add_meta_boxes', array( $primer_customizer_layouts, 'add_meta_box' ), 10); |
|
| 6424 | - } |
|
| 6425 | - } |
|
| 6420 | + $post_types = geodir_get_posttypes(); |
|
| 6421 | + if ($post_type && in_array($post_type, $post_types) ) {
|
|
| 6422 | + global $primer_customizer_layouts; |
|
| 6423 | + remove_action( 'add_meta_boxes', array( $primer_customizer_layouts, 'add_meta_box' ), 10); |
|
| 6424 | + } |
|
| 6425 | + } |
|
| 6426 | 6426 | |
| 6427 | 6427 | } |
| 6428 | 6428 | |
| 6429 | 6429 | if(is_admin()){
|
| 6430 | - add_action('add_meta_boxes','geodir_fix_for_primer_theme',0);
|
|
| 6430 | + add_action('add_meta_boxes','geodir_fix_for_primer_theme',0);
|
|
| 6431 | 6431 | } |
| 6432 | 6432 | |
| 6433 | 6433 | |
@@ -6560,65 +6560,65 @@ discard block |
||
| 6560 | 6560 | |
| 6561 | 6561 | function geodir_ga_activation_url() {
|
| 6562 | 6562 | |
| 6563 | - return add_query_arg( array( |
|
| 6564 | - 'next' => admin_url("admin.php?page=geodirectory&active_tab=google_analytic_settings"),
|
|
| 6565 | - 'scope' => GEODIR_GA_SCOPE, |
|
| 6566 | - 'response_type' => 'code', |
|
| 6567 | - 'redirect_uri' => GEODIR_GA_REDIRECT, |
|
| 6568 | - 'client_id' => GEODIR_GA_CLIENTID, |
|
| 6569 | - ), 'https://accounts.google.com/o/oauth2/auth' ); |
|
| 6563 | + return add_query_arg( array( |
|
| 6564 | + 'next' => admin_url("admin.php?page=geodirectory&active_tab=google_analytic_settings"),
|
|
| 6565 | + 'scope' => GEODIR_GA_SCOPE, |
|
| 6566 | + 'response_type' => 'code', |
|
| 6567 | + 'redirect_uri' => GEODIR_GA_REDIRECT, |
|
| 6568 | + 'client_id' => GEODIR_GA_CLIENTID, |
|
| 6569 | + ), 'https://accounts.google.com/o/oauth2/auth' ); |
|
| 6570 | 6570 | |
| 6571 | - return $url; |
|
| 6571 | + return $url; |
|
| 6572 | 6572 | } |
| 6573 | 6573 | |
| 6574 | 6574 | function geodir_gd_accounts(){
|
| 6575 | - $accounts = array(); |
|
| 6576 | - $useAuth = ( get_option( 'geodir_ga_auth_code' ) == '' ? false : true ); |
|
| 6577 | - if($useAuth){
|
|
| 6578 | - $accounts = geodir_ga_get_analytics_accounts(); |
|
| 6579 | - if(is_array($accounts)){
|
|
| 6580 | - $accounts = array_merge(array(__('Select Account','geodirectory')),$accounts);
|
|
| 6581 | - }elseif(get_option('geodir_ga_account_id')){
|
|
| 6582 | - $accounts = array(); |
|
| 6583 | - $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required','geodirectory').' ('.get_option('geodir_ga_account_id').')';
|
|
| 6584 | - } |
|
| 6585 | - } |
|
| 6586 | - return $accounts; |
|
| 6575 | + $accounts = array(); |
|
| 6576 | + $useAuth = ( get_option( 'geodir_ga_auth_code' ) == '' ? false : true ); |
|
| 6577 | + if($useAuth){
|
|
| 6578 | + $accounts = geodir_ga_get_analytics_accounts(); |
|
| 6579 | + if(is_array($accounts)){
|
|
| 6580 | + $accounts = array_merge(array(__('Select Account','geodirectory')),$accounts);
|
|
| 6581 | + }elseif(get_option('geodir_ga_account_id')){
|
|
| 6582 | + $accounts = array(); |
|
| 6583 | + $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required','geodirectory').' ('.get_option('geodir_ga_account_id').')';
|
|
| 6584 | + } |
|
| 6585 | + } |
|
| 6586 | + return $accounts; |
|
| 6587 | 6587 | } |
| 6588 | 6588 | |
| 6589 | 6589 | function geodir_ga_get_analytics_accounts() |
| 6590 | 6590 | {
|
| 6591 | - $accounts = array(); |
|
| 6591 | + $accounts = array(); |
|
| 6592 | 6592 | |
| 6593 | - if(get_option('geodir_ga_auth_token')===false){update_option('geodir_ga_auth_token','');}
|
|
| 6593 | + if(get_option('geodir_ga_auth_token')===false){update_option('geodir_ga_auth_token','');}
|
|
| 6594 | 6594 | |
| 6595 | 6595 | |
| 6596 | - if(get_option('geodir_gd_uids') && !isset($_POST['geodir_ga_auth_code'])){
|
|
| 6597 | - return get_option('geodir_gd_uids');
|
|
| 6598 | - } |
|
| 6596 | + if(get_option('geodir_gd_uids') && !isset($_POST['geodir_ga_auth_code'])){
|
|
| 6597 | + return get_option('geodir_gd_uids');
|
|
| 6598 | + } |
|
| 6599 | 6599 | |
| 6600 | 6600 | |
| 6601 | - # Create a new Gdata call |
|
| 6602 | - if ( trim(get_option('geodir_ga_auth_code')) != '' )
|
|
| 6603 | - $stats = new GDGoogleAnalyticsStats(); |
|
| 6604 | - else |
|
| 6605 | - return false; |
|
| 6601 | + # Create a new Gdata call |
|
| 6602 | + if ( trim(get_option('geodir_ga_auth_code')) != '' )
|
|
| 6603 | + $stats = new GDGoogleAnalyticsStats(); |
|
| 6604 | + else |
|
| 6605 | + return false; |
|
| 6606 | 6606 | |
| 6607 | - # Check if Google sucessfully logged in |
|
| 6608 | - if ( ! $stats->checkLogin() ) |
|
| 6609 | - return false; |
|
| 6607 | + # Check if Google sucessfully logged in |
|
| 6608 | + if ( ! $stats->checkLogin() ) |
|
| 6609 | + return false; |
|
| 6610 | 6610 | |
| 6611 | - # Get a list of accounts |
|
| 6612 | - $accounts = $stats->getAllProfiles(); |
|
| 6611 | + # Get a list of accounts |
|
| 6612 | + $accounts = $stats->getAllProfiles(); |
|
| 6613 | 6613 | |
| 6614 | - natcasesort ($accounts); |
|
| 6614 | + natcasesort ($accounts); |
|
| 6615 | 6615 | |
| 6616 | - # Return the account array if there are accounts |
|
| 6617 | - if ( count($accounts) > 0 ){
|
|
| 6618 | - update_option('geodir_gd_uids',$accounts);
|
|
| 6619 | - return $accounts; |
|
| 6620 | - } |
|
| 6621 | - else |
|
| 6622 | - return false; |
|
| 6616 | + # Return the account array if there are accounts |
|
| 6617 | + if ( count($accounts) > 0 ){
|
|
| 6618 | + update_option('geodir_gd_uids',$accounts);
|
|
| 6619 | + return $accounts; |
|
| 6620 | + } |
|
| 6621 | + else |
|
| 6622 | + return false; |
|
| 6623 | 6623 | } |
| 6624 | 6624 | |
@@ -16,87 +16,87 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | $general_options = apply_filters('geodir_general_options', array(
|
| 18 | 18 | |
| 19 | - array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
|
|
| 20 | - |
|
| 21 | - array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
|
|
| 22 | - |
|
| 23 | - array( |
|
| 24 | - 'name' => __('Sender name', 'geodirectory'),
|
|
| 25 | - 'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
|
|
| 26 | - 'id' => 'site_email_name', |
|
| 27 | - 'type' => 'text', |
|
| 28 | - 'css' => 'min-width:300px;', |
|
| 29 | - 'std' => get_bloginfo('name') // Default value for the page title - changed in settings
|
|
| 30 | - ), |
|
| 31 | - |
|
| 32 | - array( |
|
| 33 | - 'name' => __('Email address', 'geodirectory'),
|
|
| 34 | - 'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
|
|
| 35 | - 'id' => 'site_email', |
|
| 36 | - 'type' => 'text', |
|
| 37 | - 'css' => 'min-width:300px;', |
|
| 38 | - 'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
|
|
| 39 | - ), |
|
| 40 | - array( |
|
| 41 | - 'name' => __('Allow user to see wp-admin area', 'geodirectory'),
|
|
| 42 | - 'desc' => __('Yes', 'geodirectory'),
|
|
| 43 | - 'id' => 'geodir_allow_wpadmin', |
|
| 44 | - 'std' => '1', |
|
| 45 | - 'type' => 'radio', |
|
| 46 | - 'value' => '1', |
|
| 47 | - 'radiogroup' => 'start' |
|
| 48 | - ), |
|
| 49 | - array( |
|
| 50 | - 'name' => __('Allow user to see wp-admin area', 'geodirectory'),
|
|
| 51 | - 'desc' => __('No', 'geodirectory'),
|
|
| 52 | - 'id' => 'geodir_allow_wpadmin', |
|
| 53 | - 'std' => '0', |
|
| 54 | - 'type' => 'radio', |
|
| 55 | - 'value' => '0', |
|
| 56 | - 'radiogroup' => 'end' |
|
| 57 | - ), |
|
| 58 | - |
|
| 59 | - array( |
|
| 60 | - 'name' => __('Allow user to choose own password', 'geodirectory'),
|
|
| 61 | - 'desc' => __('Yes', 'geodirectory'),
|
|
| 62 | - 'id' => 'geodir_allow_cpass', |
|
| 63 | - 'std' => '1', |
|
| 64 | - 'type' => 'radio', |
|
| 65 | - 'value' => '1', |
|
| 66 | - 'radiogroup' => 'start' |
|
| 67 | - ), |
|
| 68 | - array( |
|
| 69 | - 'name' => __('Allow user to choose own password', 'geodirectory'),
|
|
| 70 | - 'desc' => __('No', 'geodirectory'),
|
|
| 71 | - 'id' => 'geodir_allow_cpass', |
|
| 72 | - 'std' => '0', |
|
| 73 | - 'type' => 'radio', |
|
| 74 | - 'value' => '0', |
|
| 75 | - 'radiogroup' => 'end' |
|
| 76 | - ), |
|
| 77 | - array( |
|
| 78 | - 'name' => __('Disable rating on comments', 'geodirectory'),
|
|
| 79 | - 'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'),
|
|
| 80 | - 'id' => 'geodir_disable_rating', |
|
| 81 | - 'type' => 'checkbox', |
|
| 82 | - 'std' => '0' |
|
| 83 | - ), |
|
| 84 | - array( |
|
| 85 | - 'name' => __('User deleted posts go to trash', 'geodirectory'),
|
|
| 86 | - 'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'),
|
|
| 87 | - 'id' => 'geodir_disable_perm_delete', |
|
| 88 | - 'type' => 'checkbox', |
|
| 89 | - 'std' => '1' |
|
| 90 | - ), |
|
| 91 | - array( |
|
| 92 | - 'name' => __('Max upload file size(in mb)', 'geodirectory'),
|
|
| 93 | - 'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2. This setting will overwrite the max upload file size limit in image/file upload & import listings for entire GeoDirectory core + GeoDirectory plugins.)', 'geodirectory'),
|
|
| 94 | - 'id' => 'geodir_upload_max_filesize', |
|
| 95 | - 'type' => 'text', |
|
| 96 | - 'css' => 'min-width:300px;', |
|
| 97 | - 'std' => '2' |
|
| 98 | - ), |
|
| 99 | - array('type' => 'sectionend', 'id' => 'general_options'),
|
|
| 19 | + array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
|
|
| 20 | + |
|
| 21 | + array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
|
|
| 22 | + |
|
| 23 | + array( |
|
| 24 | + 'name' => __('Sender name', 'geodirectory'),
|
|
| 25 | + 'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
|
|
| 26 | + 'id' => 'site_email_name', |
|
| 27 | + 'type' => 'text', |
|
| 28 | + 'css' => 'min-width:300px;', |
|
| 29 | + 'std' => get_bloginfo('name') // Default value for the page title - changed in settings
|
|
| 30 | + ), |
|
| 31 | + |
|
| 32 | + array( |
|
| 33 | + 'name' => __('Email address', 'geodirectory'),
|
|
| 34 | + 'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
|
|
| 35 | + 'id' => 'site_email', |
|
| 36 | + 'type' => 'text', |
|
| 37 | + 'css' => 'min-width:300px;', |
|
| 38 | + 'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
|
|
| 39 | + ), |
|
| 40 | + array( |
|
| 41 | + 'name' => __('Allow user to see wp-admin area', 'geodirectory'),
|
|
| 42 | + 'desc' => __('Yes', 'geodirectory'),
|
|
| 43 | + 'id' => 'geodir_allow_wpadmin', |
|
| 44 | + 'std' => '1', |
|
| 45 | + 'type' => 'radio', |
|
| 46 | + 'value' => '1', |
|
| 47 | + 'radiogroup' => 'start' |
|
| 48 | + ), |
|
| 49 | + array( |
|
| 50 | + 'name' => __('Allow user to see wp-admin area', 'geodirectory'),
|
|
| 51 | + 'desc' => __('No', 'geodirectory'),
|
|
| 52 | + 'id' => 'geodir_allow_wpadmin', |
|
| 53 | + 'std' => '0', |
|
| 54 | + 'type' => 'radio', |
|
| 55 | + 'value' => '0', |
|
| 56 | + 'radiogroup' => 'end' |
|
| 57 | + ), |
|
| 58 | + |
|
| 59 | + array( |
|
| 60 | + 'name' => __('Allow user to choose own password', 'geodirectory'),
|
|
| 61 | + 'desc' => __('Yes', 'geodirectory'),
|
|
| 62 | + 'id' => 'geodir_allow_cpass', |
|
| 63 | + 'std' => '1', |
|
| 64 | + 'type' => 'radio', |
|
| 65 | + 'value' => '1', |
|
| 66 | + 'radiogroup' => 'start' |
|
| 67 | + ), |
|
| 68 | + array( |
|
| 69 | + 'name' => __('Allow user to choose own password', 'geodirectory'),
|
|
| 70 | + 'desc' => __('No', 'geodirectory'),
|
|
| 71 | + 'id' => 'geodir_allow_cpass', |
|
| 72 | + 'std' => '0', |
|
| 73 | + 'type' => 'radio', |
|
| 74 | + 'value' => '0', |
|
| 75 | + 'radiogroup' => 'end' |
|
| 76 | + ), |
|
| 77 | + array( |
|
| 78 | + 'name' => __('Disable rating on comments', 'geodirectory'),
|
|
| 79 | + 'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'),
|
|
| 80 | + 'id' => 'geodir_disable_rating', |
|
| 81 | + 'type' => 'checkbox', |
|
| 82 | + 'std' => '0' |
|
| 83 | + ), |
|
| 84 | + array( |
|
| 85 | + 'name' => __('User deleted posts go to trash', 'geodirectory'),
|
|
| 86 | + 'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'),
|
|
| 87 | + 'id' => 'geodir_disable_perm_delete', |
|
| 88 | + 'type' => 'checkbox', |
|
| 89 | + 'std' => '1' |
|
| 90 | + ), |
|
| 91 | + array( |
|
| 92 | + 'name' => __('Max upload file size(in mb)', 'geodirectory'),
|
|
| 93 | + 'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2. This setting will overwrite the max upload file size limit in image/file upload & import listings for entire GeoDirectory core + GeoDirectory plugins.)', 'geodirectory'),
|
|
| 94 | + 'id' => 'geodir_upload_max_filesize', |
|
| 95 | + 'type' => 'text', |
|
| 96 | + 'css' => 'min-width:300px;', |
|
| 97 | + 'std' => '2' |
|
| 98 | + ), |
|
| 99 | + array('type' => 'sectionend', 'id' => 'general_options'),
|
|
| 100 | 100 | |
| 101 | 101 | ));/* General Options End*/ |
| 102 | 102 | |
@@ -108,96 +108,96 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | $google_analytic_settings = apply_filters('geodir_google_analytic_settings', array(
|
| 110 | 110 | |
| 111 | - array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'),
|
|
| 112 | - |
|
| 113 | - array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'),
|
|
| 114 | - |
|
| 115 | - |
|
| 116 | - |
|
| 117 | - array( |
|
| 118 | - 'name' => __('Show business owner google analytics stats?', 'geodirectory'),
|
|
| 119 | - 'desc' => __('Yes', 'geodirectory'),
|
|
| 120 | - 'id' => 'geodir_ga_stats', |
|
| 121 | - 'std' => '0', |
|
| 122 | - 'type' => 'radio', |
|
| 123 | - 'value' => '1', |
|
| 124 | - 'radiogroup' => 'start' |
|
| 125 | - ), |
|
| 126 | - array( |
|
| 127 | - 'name' => __('Show business owner Google Analytics stats?', 'geodirectory'),
|
|
| 128 | - 'desc' => __('No', 'geodirectory'),
|
|
| 129 | - 'id' => 'geodir_ga_stats', |
|
| 130 | - 'std' => '1', |
|
| 131 | - 'type' => 'radio', |
|
| 132 | - 'value' => '0', |
|
| 133 | - 'radiogroup' => 'end' |
|
| 134 | - ), |
|
| 135 | - |
|
| 136 | - array( |
|
| 137 | - 'name' => __('Google analytics access', 'geodirectory'),
|
|
| 138 | - 'desc' => '', |
|
| 139 | - 'id' => 'geodir_ga_token', |
|
| 140 | - 'type' => 'google_analytics', |
|
| 141 | - 'css' => 'min-width:300px;', |
|
| 142 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 143 | - ), |
|
| 144 | - |
|
| 145 | - array( |
|
| 146 | - 'name' => __('Google analytics Auth Code', 'geodirectory'),
|
|
| 147 | - 'desc' => __('You must save this setting before accounts will show.', 'geodirectory'),
|
|
| 148 | - 'id' => 'geodir_ga_auth_code', |
|
| 149 | - 'type' => 'text', |
|
| 150 | - 'css' => 'min-width:300px;', |
|
| 151 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 152 | - ), |
|
| 153 | - |
|
| 154 | - array( |
|
| 155 | - 'name' => __('Analytics Account', 'geodirectory'),
|
|
| 156 | - 'desc' => __('Select the account that you setup for this site.', 'geodirectory'),
|
|
| 157 | - 'id' => 'geodir_ga_account_id', |
|
| 158 | - 'css' => 'min-width:300px;', |
|
| 159 | - 'std' => 'gridview_onehalf', |
|
| 160 | - 'type' => 'select', |
|
| 161 | - 'class' => 'chosen_select', |
|
| 162 | - 'options' => geodir_gd_accounts() |
|
| 163 | - ), |
|
| 164 | - |
|
| 165 | - |
|
| 166 | - array( |
|
| 167 | - 'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
|
|
| 168 | - 'desc' => __('Yes <small>(this will automatically add the correct tracking code to your site)</small>', 'geodirectory'),
|
|
| 169 | - 'id' => 'geodir_ga_add_tracking_code', |
|
| 170 | - 'std' => '0', |
|
| 171 | - 'type' => 'radio', |
|
| 172 | - 'value' => '1', |
|
| 173 | - 'radiogroup' => 'start' |
|
| 174 | - ), |
|
| 175 | - array( |
|
| 176 | - 'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
|
|
| 177 | - 'desc' => __('No <small>(if you already have tracking code added you should not add it again)</small>', 'geodirectory'),
|
|
| 178 | - 'id' => 'geodir_ga_add_tracking_code', |
|
| 179 | - 'std' => '1', |
|
| 180 | - 'type' => 'radio', |
|
| 181 | - 'value' => '0', |
|
| 182 | - 'radiogroup' => 'end' |
|
| 183 | - ), |
|
| 184 | - |
|
| 185 | - array( |
|
| 186 | - 'name' => __('Auto refresh active users?', 'geodirectory'),
|
|
| 187 | - 'desc' => __('If ticked it uses the auto refresh time below, if not it never refreshes unless the refresh button is clicked.', 'geodirectory'),
|
|
| 188 | - 'id' => 'geodir_ga_auto_refresh', |
|
| 189 | - 'type' => 'checkbox', |
|
| 190 | - 'std' => '0' |
|
| 191 | - ), |
|
| 192 | - array( |
|
| 193 | - 'name' => __('Time interval for auto refresh active users', 'geodirectory'),
|
|
| 194 | - 'desc' => __('Time interval in seconds to auto refresh active users. The active users will be auto refreshed after this time interval. Leave blank or use 0(zero) to disable auto refresh. Default: 5', 'geodirectory'),
|
|
| 195 | - 'id' => 'geodir_ga_refresh_time', |
|
| 196 | - 'type' => 'text', |
|
| 197 | - 'std' => '5' |
|
| 198 | - ), |
|
| 199 | - |
|
| 200 | - array('type' => 'sectionend', 'id' => 'google_analytic_settings'),
|
|
| 111 | + array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'),
|
|
| 112 | + |
|
| 113 | + array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'),
|
|
| 114 | + |
|
| 115 | + |
|
| 116 | + |
|
| 117 | + array( |
|
| 118 | + 'name' => __('Show business owner google analytics stats?', 'geodirectory'),
|
|
| 119 | + 'desc' => __('Yes', 'geodirectory'),
|
|
| 120 | + 'id' => 'geodir_ga_stats', |
|
| 121 | + 'std' => '0', |
|
| 122 | + 'type' => 'radio', |
|
| 123 | + 'value' => '1', |
|
| 124 | + 'radiogroup' => 'start' |
|
| 125 | + ), |
|
| 126 | + array( |
|
| 127 | + 'name' => __('Show business owner Google Analytics stats?', 'geodirectory'),
|
|
| 128 | + 'desc' => __('No', 'geodirectory'),
|
|
| 129 | + 'id' => 'geodir_ga_stats', |
|
| 130 | + 'std' => '1', |
|
| 131 | + 'type' => 'radio', |
|
| 132 | + 'value' => '0', |
|
| 133 | + 'radiogroup' => 'end' |
|
| 134 | + ), |
|
| 135 | + |
|
| 136 | + array( |
|
| 137 | + 'name' => __('Google analytics access', 'geodirectory'),
|
|
| 138 | + 'desc' => '', |
|
| 139 | + 'id' => 'geodir_ga_token', |
|
| 140 | + 'type' => 'google_analytics', |
|
| 141 | + 'css' => 'min-width:300px;', |
|
| 142 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 143 | + ), |
|
| 144 | + |
|
| 145 | + array( |
|
| 146 | + 'name' => __('Google analytics Auth Code', 'geodirectory'),
|
|
| 147 | + 'desc' => __('You must save this setting before accounts will show.', 'geodirectory'),
|
|
| 148 | + 'id' => 'geodir_ga_auth_code', |
|
| 149 | + 'type' => 'text', |
|
| 150 | + 'css' => 'min-width:300px;', |
|
| 151 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 152 | + ), |
|
| 153 | + |
|
| 154 | + array( |
|
| 155 | + 'name' => __('Analytics Account', 'geodirectory'),
|
|
| 156 | + 'desc' => __('Select the account that you setup for this site.', 'geodirectory'),
|
|
| 157 | + 'id' => 'geodir_ga_account_id', |
|
| 158 | + 'css' => 'min-width:300px;', |
|
| 159 | + 'std' => 'gridview_onehalf', |
|
| 160 | + 'type' => 'select', |
|
| 161 | + 'class' => 'chosen_select', |
|
| 162 | + 'options' => geodir_gd_accounts() |
|
| 163 | + ), |
|
| 164 | + |
|
| 165 | + |
|
| 166 | + array( |
|
| 167 | + 'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
|
|
| 168 | + 'desc' => __('Yes <small>(this will automatically add the correct tracking code to your site)</small>', 'geodirectory'),
|
|
| 169 | + 'id' => 'geodir_ga_add_tracking_code', |
|
| 170 | + 'std' => '0', |
|
| 171 | + 'type' => 'radio', |
|
| 172 | + 'value' => '1', |
|
| 173 | + 'radiogroup' => 'start' |
|
| 174 | + ), |
|
| 175 | + array( |
|
| 176 | + 'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
|
|
| 177 | + 'desc' => __('No <small>(if you already have tracking code added you should not add it again)</small>', 'geodirectory'),
|
|
| 178 | + 'id' => 'geodir_ga_add_tracking_code', |
|
| 179 | + 'std' => '1', |
|
| 180 | + 'type' => 'radio', |
|
| 181 | + 'value' => '0', |
|
| 182 | + 'radiogroup' => 'end' |
|
| 183 | + ), |
|
| 184 | + |
|
| 185 | + array( |
|
| 186 | + 'name' => __('Auto refresh active users?', 'geodirectory'),
|
|
| 187 | + 'desc' => __('If ticked it uses the auto refresh time below, if not it never refreshes unless the refresh button is clicked.', 'geodirectory'),
|
|
| 188 | + 'id' => 'geodir_ga_auto_refresh', |
|
| 189 | + 'type' => 'checkbox', |
|
| 190 | + 'std' => '0' |
|
| 191 | + ), |
|
| 192 | + array( |
|
| 193 | + 'name' => __('Time interval for auto refresh active users', 'geodirectory'),
|
|
| 194 | + 'desc' => __('Time interval in seconds to auto refresh active users. The active users will be auto refreshed after this time interval. Leave blank or use 0(zero) to disable auto refresh. Default: 5', 'geodirectory'),
|
|
| 195 | + 'id' => 'geodir_ga_refresh_time', |
|
| 196 | + 'type' => 'text', |
|
| 197 | + 'std' => '5' |
|
| 198 | + ), |
|
| 199 | + |
|
| 200 | + array('type' => 'sectionend', 'id' => 'google_analytic_settings'),
|
|
| 201 | 201 | |
| 202 | 202 | )); // google_analytic_settings End |
| 203 | 203 | |
@@ -209,84 +209,84 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | $search_settings = apply_filters('geodir_search_settings', array(
|
| 211 | 211 | |
| 212 | - array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'),
|
|
| 213 | - |
|
| 214 | - array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'),
|
|
| 215 | - |
|
| 216 | - array( |
|
| 217 | - 'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'),
|
|
| 218 | - 'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'),
|
|
| 219 | - 'id' => 'geodir_search_dist', |
|
| 220 | - 'type' => 'text', |
|
| 221 | - 'css' => 'min-width:300px;', |
|
| 222 | - 'std' => '40' // Default value for the page title - changed in settings |
|
| 223 | - ), |
|
| 224 | - |
|
| 225 | - array( |
|
| 226 | - 'name' => __('Show search distances in miles or km', 'geodirectory'),
|
|
| 227 | - 'desc' => __('Miles', 'geodirectory'),
|
|
| 228 | - 'id' => 'geodir_search_dist_1', |
|
| 229 | - 'std' => 'miles', |
|
| 230 | - 'type' => 'radio', |
|
| 231 | - 'value' => 'miles', |
|
| 232 | - 'radiogroup' => 'start' |
|
| 233 | - ), |
|
| 234 | - array( |
|
| 235 | - 'name' => __('Show search distances in miles or km', 'geodirectory'),
|
|
| 236 | - 'desc' => __('Kilometers', 'geodirectory'),
|
|
| 237 | - 'id' => 'geodir_search_dist_1', |
|
| 238 | - 'std' => 'miles', |
|
| 239 | - 'type' => 'radio', |
|
| 240 | - 'value' => 'km', |
|
| 241 | - 'radiogroup' => 'end' |
|
| 242 | - ), |
|
| 243 | - |
|
| 244 | - array( |
|
| 245 | - 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
|
|
| 246 | - 'desc' => __('Meters', 'geodirectory'),
|
|
| 247 | - 'id' => 'geodir_search_dist_2', |
|
| 248 | - 'std' => 'meters', |
|
| 249 | - 'type' => 'radio', |
|
| 250 | - 'value' => 'meters', |
|
| 251 | - 'radiogroup' => 'start' |
|
| 252 | - ), |
|
| 253 | - |
|
| 254 | - array( |
|
| 255 | - 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
|
|
| 256 | - 'desc' => __('Feet', 'geodirectory'),
|
|
| 257 | - 'id' => 'geodir_search_dist_2', |
|
| 258 | - 'std' => 'meters', |
|
| 259 | - 'type' => 'radio', |
|
| 260 | - 'value' => 'feet', |
|
| 261 | - 'radiogroup' => 'end' |
|
| 262 | - ), |
|
| 263 | - |
|
| 264 | - array( |
|
| 265 | - 'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'),
|
|
| 266 | - 'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'),
|
|
| 267 | - 'id' => 'geodir_search_near_addition', |
|
| 268 | - 'type' => 'text', |
|
| 269 | - 'css' => 'min-width:300px;', |
|
| 270 | - 'std' => '' |
|
| 271 | - ), |
|
| 272 | - array( |
|
| 273 | - 'name' => __('Individual word search limit', 'geodirectory'),
|
|
| 274 | - 'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'),
|
|
| 275 | - 'id' => 'geodir_search_word_limit', |
|
| 276 | - 'css' => 'min-width:300px;', |
|
| 277 | - 'std' => 'gridview_onehalf', |
|
| 278 | - 'type' => 'select', |
|
| 279 | - 'class' => 'chosen_select', |
|
| 280 | - 'options' => array_unique(array( |
|
| 281 | - '0' => __('Disabled', 'geodirectory'),
|
|
| 282 | - '1' => __('1 Character words excluded', 'geodirectory'),
|
|
| 283 | - '2' => __('2 Character words and less excluded', 'geodirectory'),
|
|
| 284 | - '3' => __('3 Character words and less excluded', 'geodirectory'),
|
|
| 285 | - )) |
|
| 286 | - ), |
|
| 287 | - |
|
| 288 | - |
|
| 289 | - array('type' => 'sectionend', 'id' => 'search_settings'),
|
|
| 212 | + array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'),
|
|
| 213 | + |
|
| 214 | + array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'),
|
|
| 215 | + |
|
| 216 | + array( |
|
| 217 | + 'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'),
|
|
| 218 | + 'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'),
|
|
| 219 | + 'id' => 'geodir_search_dist', |
|
| 220 | + 'type' => 'text', |
|
| 221 | + 'css' => 'min-width:300px;', |
|
| 222 | + 'std' => '40' // Default value for the page title - changed in settings |
|
| 223 | + ), |
|
| 224 | + |
|
| 225 | + array( |
|
| 226 | + 'name' => __('Show search distances in miles or km', 'geodirectory'),
|
|
| 227 | + 'desc' => __('Miles', 'geodirectory'),
|
|
| 228 | + 'id' => 'geodir_search_dist_1', |
|
| 229 | + 'std' => 'miles', |
|
| 230 | + 'type' => 'radio', |
|
| 231 | + 'value' => 'miles', |
|
| 232 | + 'radiogroup' => 'start' |
|
| 233 | + ), |
|
| 234 | + array( |
|
| 235 | + 'name' => __('Show search distances in miles or km', 'geodirectory'),
|
|
| 236 | + 'desc' => __('Kilometers', 'geodirectory'),
|
|
| 237 | + 'id' => 'geodir_search_dist_1', |
|
| 238 | + 'std' => 'miles', |
|
| 239 | + 'type' => 'radio', |
|
| 240 | + 'value' => 'km', |
|
| 241 | + 'radiogroup' => 'end' |
|
| 242 | + ), |
|
| 243 | + |
|
| 244 | + array( |
|
| 245 | + 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
|
|
| 246 | + 'desc' => __('Meters', 'geodirectory'),
|
|
| 247 | + 'id' => 'geodir_search_dist_2', |
|
| 248 | + 'std' => 'meters', |
|
| 249 | + 'type' => 'radio', |
|
| 250 | + 'value' => 'meters', |
|
| 251 | + 'radiogroup' => 'start' |
|
| 252 | + ), |
|
| 253 | + |
|
| 254 | + array( |
|
| 255 | + 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
|
|
| 256 | + 'desc' => __('Feet', 'geodirectory'),
|
|
| 257 | + 'id' => 'geodir_search_dist_2', |
|
| 258 | + 'std' => 'meters', |
|
| 259 | + 'type' => 'radio', |
|
| 260 | + 'value' => 'feet', |
|
| 261 | + 'radiogroup' => 'end' |
|
| 262 | + ), |
|
| 263 | + |
|
| 264 | + array( |
|
| 265 | + 'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'),
|
|
| 266 | + 'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'),
|
|
| 267 | + 'id' => 'geodir_search_near_addition', |
|
| 268 | + 'type' => 'text', |
|
| 269 | + 'css' => 'min-width:300px;', |
|
| 270 | + 'std' => '' |
|
| 271 | + ), |
|
| 272 | + array( |
|
| 273 | + 'name' => __('Individual word search limit', 'geodirectory'),
|
|
| 274 | + 'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'),
|
|
| 275 | + 'id' => 'geodir_search_word_limit', |
|
| 276 | + 'css' => 'min-width:300px;', |
|
| 277 | + 'std' => 'gridview_onehalf', |
|
| 278 | + 'type' => 'select', |
|
| 279 | + 'class' => 'chosen_select', |
|
| 280 | + 'options' => array_unique(array( |
|
| 281 | + '0' => __('Disabled', 'geodirectory'),
|
|
| 282 | + '1' => __('1 Character words excluded', 'geodirectory'),
|
|
| 283 | + '2' => __('2 Character words and less excluded', 'geodirectory'),
|
|
| 284 | + '3' => __('3 Character words and less excluded', 'geodirectory'),
|
|
| 285 | + )) |
|
| 286 | + ), |
|
| 287 | + |
|
| 288 | + |
|
| 289 | + array('type' => 'sectionend', 'id' => 'search_settings'),
|
|
| 290 | 290 | |
| 291 | 291 | )); //search_settings End |
| 292 | 292 | |
@@ -298,17 +298,17 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | $dummy_data_settings = apply_filters('geodir_dummy_data_settings', array(
|
| 300 | 300 | |
| 301 | - array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'),
|
|
| 302 | - |
|
| 303 | - array( |
|
| 304 | - 'name' => '', |
|
| 305 | - 'desc' => '', |
|
| 306 | - 'id' => 'geodir_dummy_data_installer', |
|
| 307 | - 'type' => 'dummy_installer', |
|
| 308 | - 'css' => 'min-width:300px;', |
|
| 309 | - 'std' => '40' // Default value for the page title - changed in settings |
|
| 310 | - ), |
|
| 311 | - array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'),
|
|
| 301 | + array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'),
|
|
| 302 | + |
|
| 303 | + array( |
|
| 304 | + 'name' => '', |
|
| 305 | + 'desc' => '', |
|
| 306 | + 'id' => 'geodir_dummy_data_installer', |
|
| 307 | + 'type' => 'dummy_installer', |
|
| 308 | + 'css' => 'min-width:300px;', |
|
| 309 | + 'std' => '40' // Default value for the page title - changed in settings |
|
| 310 | + ), |
|
| 311 | + array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'),
|
|
| 312 | 312 | |
| 313 | 313 | )); //dummy_data_settings End |
| 314 | 314 | |
@@ -34,138 +34,138 @@ discard block |
||
| 34 | 34 | require_once 'google-api-php-client/src/contrib/Google_AnalyticsService.php'; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $this->client = new Google_Client(); |
|
| 38 | - $this->client->setApprovalPrompt("force"); |
|
| 39 | - $this->client->setAccessType('offline'); |
|
| 40 | - $this->client->setClientId(GEODIR_GA_CLIENTID); |
|
| 41 | - $this->client->setClientSecret(GEODIR_GA_CLIENTSECRET); |
|
| 42 | - $this->client->setRedirectUri(GEODIR_GA_REDIRECT); |
|
| 37 | + $this->client = new Google_Client(); |
|
| 38 | + $this->client->setApprovalPrompt("force"); |
|
| 39 | + $this->client->setAccessType('offline'); |
|
| 40 | + $this->client->setClientId(GEODIR_GA_CLIENTID); |
|
| 41 | + $this->client->setClientSecret(GEODIR_GA_CLIENTSECRET); |
|
| 42 | + $this->client->setRedirectUri(GEODIR_GA_REDIRECT); |
|
| 43 | 43 | |
| 44 | - $this->client->setScopes(array("https://www.googleapis.com/auth/analytics")); |
|
| 44 | + $this->client->setScopes(array("https://www.googleapis.com/auth/analytics")); |
|
| 45 | 45 | |
| 46 | - // Magic. Returns objects from the Analytics Service instead of associative arrays. |
|
| 47 | - $this->client->setUseObjects(true); |
|
| 46 | + // Magic. Returns objects from the Analytics Service instead of associative arrays. |
|
| 47 | + $this->client->setUseObjects(true); |
|
| 48 | 48 | |
| 49 | - try { |
|
| 50 | - $this->analytics = new Google_AnalyticsService($this->client); |
|
| 51 | - } |
|
| 52 | - catch (Google_ServiceException $e) |
|
| 53 | - { |
|
| 54 | - print '(cas:48) There was an Analytics API service error ' . $e->getCode() . ':' . $e->getMessage(); |
|
| 49 | + try { |
|
| 50 | + $this->analytics = new Google_AnalyticsService($this->client); |
|
| 51 | + } |
|
| 52 | + catch (Google_ServiceException $e) |
|
| 53 | + { |
|
| 54 | + print '(cas:48) There was an Analytics API service error ' . $e->getCode() . ':' . $e->getMessage(); |
|
| 55 | 55 | return false; |
| 56 | - } |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | function checkLogin() |
| 60 | 60 | { |
| 61 | - $ga_google_authtoken = get_option('geodir_ga_auth_token'); |
|
| 61 | + $ga_google_authtoken = get_option('geodir_ga_auth_token'); |
|
| 62 | 62 | |
| 63 | - if (!empty($ga_google_authtoken)) |
|
| 64 | - { |
|
| 63 | + if (!empty($ga_google_authtoken)) |
|
| 64 | + { |
|
| 65 | 65 | try |
| 66 | - { |
|
| 67 | - $this->client->setAccessToken($ga_google_authtoken); |
|
| 66 | + { |
|
| 67 | + $this->client->setAccessToken($ga_google_authtoken); |
|
| 68 | 68 | } |
| 69 | 69 | catch( Google_AuthException $e ) |
| 70 | - { |
|
| 71 | - print '(cas:72) GeoDirectory was unable to authenticate you with |
|
| 70 | + { |
|
| 71 | + print '(cas:72) GeoDirectory was unable to authenticate you with |
|
| 72 | 72 | Google using the Auth Token you pasted into the input box on the previous step. <br><br> |
| 73 | 73 | This could mean either you pasted the token wrong, or the time/date on your server is wrong, |
| 74 | 74 | or an SSL issue preventing Google from Authenticating. <br><br> |
| 75 | 75 | <br><br><strong>Tech Info </strong> ' . $e->getCode() . ':' . $e->getMessage(); |
| 76 | 76 | |
| 77 | - return false; |
|
| 78 | - } |
|
| 79 | - } |
|
| 80 | - else |
|
| 81 | - { |
|
| 82 | - $authCode = get_option('geodir_ga_auth_code'); |
|
| 83 | - |
|
| 84 | - if (empty($authCode)) return false; |
|
| 85 | - |
|
| 86 | - try |
|
| 87 | - { |
|
| 88 | - $accessToken = $this->client->authenticate($authCode); |
|
| 89 | - } |
|
| 90 | - catch( Exception $e ) |
|
| 91 | - { |
|
| 92 | - print '(cas:72) GeoDirectory was unable to authenticate you with |
|
| 77 | + return false; |
|
| 78 | + } |
|
| 79 | + } |
|
| 80 | + else |
|
| 81 | + { |
|
| 82 | + $authCode = get_option('geodir_ga_auth_code'); |
|
| 83 | + |
|
| 84 | + if (empty($authCode)) return false; |
|
| 85 | + |
|
| 86 | + try |
|
| 87 | + { |
|
| 88 | + $accessToken = $this->client->authenticate($authCode); |
|
| 89 | + } |
|
| 90 | + catch( Exception $e ) |
|
| 91 | + { |
|
| 92 | + print '(cas:72) GeoDirectory was unable to authenticate you with |
|
| 93 | 93 | Google using the Auth Token you pasted into the input box on the previous step. <br><br> |
| 94 | 94 | This could mean either you pasted the token wrong, or the time/date on your server is wrong, |
| 95 | 95 | or an SSL issue preventing Google from Authenticating. <br><br> |
| 96 | 96 | <br><br><strong>Tech Info </strong> ' . $e->getCode() . ':' . $e->getMessage(); |
| 97 | 97 | |
| 98 | - return false; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - if($accessToken) |
|
| 102 | - { |
|
| 103 | - $this->client->setAccessToken($accessToken); |
|
| 104 | - update_option('geodir_ga_auth_token', $accessToken); |
|
| 105 | - } |
|
| 106 | - else |
|
| 107 | - { |
|
| 108 | - return false; |
|
| 109 | - } |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - $this->token = $this->client->getAccessToken(); |
|
| 113 | - return true; |
|
| 98 | + return false; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + if($accessToken) |
|
| 102 | + { |
|
| 103 | + $this->client->setAccessToken($accessToken); |
|
| 104 | + update_option('geodir_ga_auth_token', $accessToken); |
|
| 105 | + } |
|
| 106 | + else |
|
| 107 | + { |
|
| 108 | + return false; |
|
| 109 | + } |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + $this->token = $this->client->getAccessToken(); |
|
| 113 | + return true; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | function deauthorize() |
| 117 | 117 | { |
| 118 | - update_option('geodir_ga_auth_code', ''); |
|
| 119 | - update_option('geodir_ga_auth_token', ''); |
|
| 118 | + update_option('geodir_ga_auth_code', ''); |
|
| 119 | + update_option('geodir_ga_auth_token', ''); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | function getSingleProfile() |
| 123 | 123 | { |
| 124 | - $webproperty_id = get_option('geodir_ga_account_id'); |
|
| 125 | - list($pre, $account_id, $post) = explode('-',$webproperty_id); |
|
| 126 | - |
|
| 127 | - if (empty($webproperty_id)) return false; |
|
| 128 | - |
|
| 129 | - try { |
|
| 130 | - $profiles = $this->analytics->management_profiles->listManagementProfiles($account_id, $webproperty_id); |
|
| 131 | - } |
|
| 132 | - catch (Google_ServiceException $e) |
|
| 133 | - { |
|
| 134 | - print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); |
|
| 135 | - return false; |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - $profile_id = $profiles->items[0]->id; |
|
| 139 | - if (empty($profile_id)) return false; |
|
| 140 | - |
|
| 141 | - $account_array = array(); |
|
| 142 | - array_push($account_array, array('id'=>$profile_id, 'ga:webPropertyId'=>$webproperty_id)); |
|
| 143 | - return $account_array; |
|
| 124 | + $webproperty_id = get_option('geodir_ga_account_id'); |
|
| 125 | + list($pre, $account_id, $post) = explode('-',$webproperty_id); |
|
| 126 | + |
|
| 127 | + if (empty($webproperty_id)) return false; |
|
| 128 | + |
|
| 129 | + try { |
|
| 130 | + $profiles = $this->analytics->management_profiles->listManagementProfiles($account_id, $webproperty_id); |
|
| 131 | + } |
|
| 132 | + catch (Google_ServiceException $e) |
|
| 133 | + { |
|
| 134 | + print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); |
|
| 135 | + return false; |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + $profile_id = $profiles->items[0]->id; |
|
| 139 | + if (empty($profile_id)) return false; |
|
| 140 | + |
|
| 141 | + $account_array = array(); |
|
| 142 | + array_push($account_array, array('id'=>$profile_id, 'ga:webPropertyId'=>$webproperty_id)); |
|
| 143 | + return $account_array; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - function getAllProfiles() |
|
| 147 | - { |
|
| 148 | - $profile_array = array(); |
|
| 146 | + function getAllProfiles() |
|
| 147 | + { |
|
| 148 | + $profile_array = array(); |
|
| 149 | 149 | |
| 150 | - try { |
|
| 151 | - $profiles = $this->analytics->management_webproperties->listManagementWebproperties('~all'); |
|
| 152 | - } |
|
| 153 | - catch (Google_ServiceException $e) |
|
| 154 | - { |
|
| 155 | - print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - |
|
| 159 | - if( !empty( $profiles->items ) ) |
|
| 160 | - { |
|
| 161 | - foreach( $profiles->items as $profile ) |
|
| 162 | - { |
|
| 163 | - $profile_array[ $profile->id ] = str_replace('http://','',$profile->name ); |
|
| 164 | - } |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - return $profile_array; |
|
| 168 | - } |
|
| 150 | + try { |
|
| 151 | + $profiles = $this->analytics->management_webproperties->listManagementWebproperties('~all'); |
|
| 152 | + } |
|
| 153 | + catch (Google_ServiceException $e) |
|
| 154 | + { |
|
| 155 | + print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + |
|
| 159 | + if( !empty( $profiles->items ) ) |
|
| 160 | + { |
|
| 161 | + foreach( $profiles->items as $profile ) |
|
| 162 | + { |
|
| 163 | + $profile_array[ $profile->id ] = str_replace('http://','',$profile->name ); |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + return $profile_array; |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | function getAnalyticsAccounts() |
| 171 | 171 | { |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | $params['max-results'] = $limit; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking |
|
| 252 | - $filtered_id = str_replace( 'ga:', '', $this->accountId ); |
|
| 251 | + // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking |
|
| 252 | + $filtered_id = str_replace( 'ga:', '', $this->accountId ); |
|
| 253 | 253 | |
| 254 | - if(!$filtered_id){ |
|
| 255 | - echo 'Error - Account ID is blank'; |
|
| 256 | - return false; |
|
| 257 | - } |
|
| 254 | + if(!$filtered_id){ |
|
| 255 | + echo 'Error - Account ID is blank'; |
|
| 256 | + return false; |
|
| 257 | + } |
|
| 258 | 258 | |
| 259 | 259 | if($realtime){ |
| 260 | 260 | return $analytics->data_realtime->get( |
@@ -36,33 +36,33 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | class Google_DataGaServiceResource extends Google_ServiceResource { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Returns Analytics data for a view (profile). (ga.get) |
|
| 41 | - * |
|
| 42 | - * @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. |
|
| 43 | - * @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD. |
|
| 44 | - * @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD. |
|
| 45 | - * @param string $metrics A comma-separated list of Analytics metrics. E.g., 'ga:visits,ga:pageviews'. At least one metric must be specified. |
|
| 46 | - * @param array $optParams Optional parameters. |
|
| 47 | - * |
|
| 48 | - * @opt_param string dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. |
|
| 49 | - * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to Analytics data. |
|
| 50 | - * @opt_param int max-results The maximum number of entries to include in this feed. |
|
| 51 | - * @opt_param string segment An Analytics advanced segment to be applied to data. |
|
| 52 | - * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. |
|
| 53 | - * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 54 | - * @return Google_GaData |
|
| 55 | - */ |
|
| 56 | - public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) { |
|
| 57 | - $params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics); |
|
| 58 | - $params = array_merge($params, $optParams); |
|
| 59 | - $data = $this->__call('get', array($params)); |
|
| 60 | - if ($this->useObjects()) { |
|
| 61 | - return new Google_GaData($data); |
|
| 62 | - } else { |
|
| 63 | - return $data; |
|
| 64 | - } |
|
| 65 | - } |
|
| 39 | + /** |
|
| 40 | + * Returns Analytics data for a view (profile). (ga.get) |
|
| 41 | + * |
|
| 42 | + * @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. |
|
| 43 | + * @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD. |
|
| 44 | + * @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD. |
|
| 45 | + * @param string $metrics A comma-separated list of Analytics metrics. E.g., 'ga:visits,ga:pageviews'. At least one metric must be specified. |
|
| 46 | + * @param array $optParams Optional parameters. |
|
| 47 | + * |
|
| 48 | + * @opt_param string dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. |
|
| 49 | + * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to Analytics data. |
|
| 50 | + * @opt_param int max-results The maximum number of entries to include in this feed. |
|
| 51 | + * @opt_param string segment An Analytics advanced segment to be applied to data. |
|
| 52 | + * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. |
|
| 53 | + * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 54 | + * @return Google_GaData |
|
| 55 | + */ |
|
| 56 | + public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) { |
|
| 57 | + $params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics); |
|
| 58 | + $params = array_merge($params, $optParams); |
|
| 59 | + $data = $this->__call('get', array($params)); |
|
| 60 | + if ($this->useObjects()) { |
|
| 61 | + return new Google_GaData($data); |
|
| 62 | + } else { |
|
| 63 | + return $data; |
|
| 64 | + } |
|
| 65 | + } |
|
| 66 | 66 | } |
| 67 | 67 | /** |
| 68 | 68 | * The "mcf" collection of methods. |
@@ -74,32 +74,32 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | class Google_DataMcfServiceResource extends Google_ServiceResource { |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Returns Analytics Multi-Channel Funnels data for a view (profile). (mcf.get) |
|
| 79 | - * |
|
| 80 | - * @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. |
|
| 81 | - * @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD. |
|
| 82 | - * @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD. |
|
| 83 | - * @param string $metrics A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. |
|
| 84 | - * @param array $optParams Optional parameters. |
|
| 85 | - * |
|
| 86 | - * @opt_param string dimensions A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. |
|
| 87 | - * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to the Analytics data. |
|
| 88 | - * @opt_param int max-results The maximum number of entries to include in this feed. |
|
| 89 | - * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. |
|
| 90 | - * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 91 | - * @return Google_McfData |
|
| 92 | - */ |
|
| 93 | - public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) { |
|
| 94 | - $params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics); |
|
| 95 | - $params = array_merge($params, $optParams); |
|
| 96 | - $data = $this->__call('get', array($params)); |
|
| 97 | - if ($this->useObjects()) { |
|
| 98 | - return new Google_McfData($data); |
|
| 99 | - } else { |
|
| 100 | - return $data; |
|
| 101 | - } |
|
| 102 | - } |
|
| 77 | + /** |
|
| 78 | + * Returns Analytics Multi-Channel Funnels data for a view (profile). (mcf.get) |
|
| 79 | + * |
|
| 80 | + * @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. |
|
| 81 | + * @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD. |
|
| 82 | + * @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD. |
|
| 83 | + * @param string $metrics A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. |
|
| 84 | + * @param array $optParams Optional parameters. |
|
| 85 | + * |
|
| 86 | + * @opt_param string dimensions A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. |
|
| 87 | + * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to the Analytics data. |
|
| 88 | + * @opt_param int max-results The maximum number of entries to include in this feed. |
|
| 89 | + * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. |
|
| 90 | + * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 91 | + * @return Google_McfData |
|
| 92 | + */ |
|
| 93 | + public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) { |
|
| 94 | + $params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics); |
|
| 95 | + $params = array_merge($params, $optParams); |
|
| 96 | + $data = $this->__call('get', array($params)); |
|
| 97 | + if ($this->useObjects()) { |
|
| 98 | + return new Google_McfData($data); |
|
| 99 | + } else { |
|
| 100 | + return $data; |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | 103 | } |
| 104 | 104 | /** |
| 105 | 105 | * The "realtime" collection of methods. |
@@ -111,29 +111,29 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | class Google_DataRealtimeServiceResource extends Google_ServiceResource { |
| 113 | 113 | |
| 114 | - /** |
|
| 115 | - * Returns real time data for a view (profile). (realtime.get) |
|
| 116 | - * |
|
| 117 | - * @param string $ids Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. |
|
| 118 | - * @param string $metrics A comma-separated list of real time metrics. E.g., 'ga:activeVisitors'. At least one metric must be specified. |
|
| 119 | - * @param array $optParams Optional parameters. |
|
| 120 | - * |
|
| 121 | - * @opt_param string dimensions A comma-separated list of real time dimensions. E.g., 'ga:medium,ga:city'. |
|
| 122 | - * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to real time data. |
|
| 123 | - * @opt_param int max-results The maximum number of entries to include in this feed. |
|
| 124 | - * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for real time data. |
|
| 125 | - * @return Google_RealtimeData |
|
| 126 | - */ |
|
| 127 | - public function get($ids, $metrics, $optParams = array()) { |
|
| 128 | - $params = array('ids' => $ids, 'metrics' => $metrics); |
|
| 129 | - $params = array_merge($params, $optParams); |
|
| 130 | - $data = $this->__call('get', array($params)); |
|
| 131 | - if ($this->useObjects()) { |
|
| 132 | - return new Google_RealtimeData($data); |
|
| 133 | - } else { |
|
| 134 | - return $data; |
|
| 135 | - } |
|
| 136 | - } |
|
| 114 | + /** |
|
| 115 | + * Returns real time data for a view (profile). (realtime.get) |
|
| 116 | + * |
|
| 117 | + * @param string $ids Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. |
|
| 118 | + * @param string $metrics A comma-separated list of real time metrics. E.g., 'ga:activeVisitors'. At least one metric must be specified. |
|
| 119 | + * @param array $optParams Optional parameters. |
|
| 120 | + * |
|
| 121 | + * @opt_param string dimensions A comma-separated list of real time dimensions. E.g., 'ga:medium,ga:city'. |
|
| 122 | + * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to real time data. |
|
| 123 | + * @opt_param int max-results The maximum number of entries to include in this feed. |
|
| 124 | + * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for real time data. |
|
| 125 | + * @return Google_RealtimeData |
|
| 126 | + */ |
|
| 127 | + public function get($ids, $metrics, $optParams = array()) { |
|
| 128 | + $params = array('ids' => $ids, 'metrics' => $metrics); |
|
| 129 | + $params = array_merge($params, $optParams); |
|
| 130 | + $data = $this->__call('get', array($params)); |
|
| 131 | + if ($this->useObjects()) { |
|
| 132 | + return new Google_RealtimeData($data); |
|
| 133 | + } else { |
|
| 134 | + return $data; |
|
| 135 | + } |
|
| 136 | + } |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -158,77 +158,77 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | class Google_ManagementAccountUserLinksServiceResource extends Google_ServiceResource { |
| 160 | 160 | |
| 161 | - /** |
|
| 162 | - * Removes a user from the given account. (accountUserLinks.delete) |
|
| 163 | - * |
|
| 164 | - * @param string $accountId Account ID to delete the user link for. |
|
| 165 | - * @param string $linkId Link ID to delete the user link for. |
|
| 166 | - * @param array $optParams Optional parameters. |
|
| 167 | - */ |
|
| 168 | - public function delete($accountId, $linkId, $optParams = array()) { |
|
| 169 | - $params = array('accountId' => $accountId, 'linkId' => $linkId); |
|
| 170 | - $params = array_merge($params, $optParams); |
|
| 171 | - $data = $this->__call('delete', array($params)); |
|
| 172 | - return $data; |
|
| 173 | - } |
|
| 174 | - /** |
|
| 175 | - * Adds a new user to the given account. (accountUserLinks.insert) |
|
| 176 | - * |
|
| 177 | - * @param string $accountId Account ID to create the user link for. |
|
| 178 | - * @param Google_EntityUserLink $postBody |
|
| 179 | - * @param array $optParams Optional parameters. |
|
| 180 | - * @return Google_EntityUserLink |
|
| 181 | - */ |
|
| 182 | - public function insert($accountId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 183 | - $params = array('accountId' => $accountId, 'postBody' => $postBody); |
|
| 184 | - $params = array_merge($params, $optParams); |
|
| 185 | - $data = $this->__call('insert', array($params)); |
|
| 186 | - if ($this->useObjects()) { |
|
| 187 | - return new Google_EntityUserLink($data); |
|
| 188 | - } else { |
|
| 189 | - return $data; |
|
| 190 | - } |
|
| 191 | - } |
|
| 192 | - /** |
|
| 193 | - * Lists account-user links for a given account. (accountUserLinks.list) |
|
| 194 | - * |
|
| 195 | - * @param string $accountId Account ID to retrieve the user links for. |
|
| 196 | - * @param array $optParams Optional parameters. |
|
| 197 | - * |
|
| 198 | - * @opt_param int max-results The maximum number of account-user links to include in this response. |
|
| 199 | - * @opt_param int start-index An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 200 | - * @return Google_EntityUserLinks |
|
| 201 | - */ |
|
| 202 | - public function listManagementAccountUserLinks($accountId, $optParams = array()) { |
|
| 203 | - $params = array('accountId' => $accountId); |
|
| 204 | - $params = array_merge($params, $optParams); |
|
| 205 | - $data = $this->__call('list', array($params)); |
|
| 206 | - if ($this->useObjects()) { |
|
| 207 | - return new Google_EntityUserLinks($data); |
|
| 208 | - } else { |
|
| 209 | - return $data; |
|
| 210 | - } |
|
| 211 | - } |
|
| 212 | - /** |
|
| 213 | - * Updates permissions for an existing user on the given account. |
|
| 214 | - * (accountUserLinks.update) |
|
| 215 | - * |
|
| 216 | - * @param string $accountId Account ID to update the account-user link for. |
|
| 217 | - * @param string $linkId Link ID to update the account-user link for. |
|
| 218 | - * @param Google_EntityUserLink $postBody |
|
| 219 | - * @param array $optParams Optional parameters. |
|
| 220 | - * @return Google_EntityUserLink |
|
| 221 | - */ |
|
| 222 | - public function update($accountId, $linkId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 223 | - $params = array('accountId' => $accountId, 'linkId' => $linkId, 'postBody' => $postBody); |
|
| 224 | - $params = array_merge($params, $optParams); |
|
| 225 | - $data = $this->__call('update', array($params)); |
|
| 226 | - if ($this->useObjects()) { |
|
| 227 | - return new Google_EntityUserLink($data); |
|
| 228 | - } else { |
|
| 229 | - return $data; |
|
| 230 | - } |
|
| 231 | - } |
|
| 161 | + /** |
|
| 162 | + * Removes a user from the given account. (accountUserLinks.delete) |
|
| 163 | + * |
|
| 164 | + * @param string $accountId Account ID to delete the user link for. |
|
| 165 | + * @param string $linkId Link ID to delete the user link for. |
|
| 166 | + * @param array $optParams Optional parameters. |
|
| 167 | + */ |
|
| 168 | + public function delete($accountId, $linkId, $optParams = array()) { |
|
| 169 | + $params = array('accountId' => $accountId, 'linkId' => $linkId); |
|
| 170 | + $params = array_merge($params, $optParams); |
|
| 171 | + $data = $this->__call('delete', array($params)); |
|
| 172 | + return $data; |
|
| 173 | + } |
|
| 174 | + /** |
|
| 175 | + * Adds a new user to the given account. (accountUserLinks.insert) |
|
| 176 | + * |
|
| 177 | + * @param string $accountId Account ID to create the user link for. |
|
| 178 | + * @param Google_EntityUserLink $postBody |
|
| 179 | + * @param array $optParams Optional parameters. |
|
| 180 | + * @return Google_EntityUserLink |
|
| 181 | + */ |
|
| 182 | + public function insert($accountId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 183 | + $params = array('accountId' => $accountId, 'postBody' => $postBody); |
|
| 184 | + $params = array_merge($params, $optParams); |
|
| 185 | + $data = $this->__call('insert', array($params)); |
|
| 186 | + if ($this->useObjects()) { |
|
| 187 | + return new Google_EntityUserLink($data); |
|
| 188 | + } else { |
|
| 189 | + return $data; |
|
| 190 | + } |
|
| 191 | + } |
|
| 192 | + /** |
|
| 193 | + * Lists account-user links for a given account. (accountUserLinks.list) |
|
| 194 | + * |
|
| 195 | + * @param string $accountId Account ID to retrieve the user links for. |
|
| 196 | + * @param array $optParams Optional parameters. |
|
| 197 | + * |
|
| 198 | + * @opt_param int max-results The maximum number of account-user links to include in this response. |
|
| 199 | + * @opt_param int start-index An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 200 | + * @return Google_EntityUserLinks |
|
| 201 | + */ |
|
| 202 | + public function listManagementAccountUserLinks($accountId, $optParams = array()) { |
|
| 203 | + $params = array('accountId' => $accountId); |
|
| 204 | + $params = array_merge($params, $optParams); |
|
| 205 | + $data = $this->__call('list', array($params)); |
|
| 206 | + if ($this->useObjects()) { |
|
| 207 | + return new Google_EntityUserLinks($data); |
|
| 208 | + } else { |
|
| 209 | + return $data; |
|
| 210 | + } |
|
| 211 | + } |
|
| 212 | + /** |
|
| 213 | + * Updates permissions for an existing user on the given account. |
|
| 214 | + * (accountUserLinks.update) |
|
| 215 | + * |
|
| 216 | + * @param string $accountId Account ID to update the account-user link for. |
|
| 217 | + * @param string $linkId Link ID to update the account-user link for. |
|
| 218 | + * @param Google_EntityUserLink $postBody |
|
| 219 | + * @param array $optParams Optional parameters. |
|
| 220 | + * @return Google_EntityUserLink |
|
| 221 | + */ |
|
| 222 | + public function update($accountId, $linkId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 223 | + $params = array('accountId' => $accountId, 'linkId' => $linkId, 'postBody' => $postBody); |
|
| 224 | + $params = array_merge($params, $optParams); |
|
| 225 | + $data = $this->__call('update', array($params)); |
|
| 226 | + if ($this->useObjects()) { |
|
| 227 | + return new Google_EntityUserLink($data); |
|
| 228 | + } else { |
|
| 229 | + return $data; |
|
| 230 | + } |
|
| 231 | + } |
|
| 232 | 232 | } |
| 233 | 233 | /** |
| 234 | 234 | * The "accounts" collection of methods. |
@@ -240,25 +240,25 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | class Google_ManagementAccountsServiceResource extends Google_ServiceResource { |
| 242 | 242 | |
| 243 | - /** |
|
| 244 | - * Lists all accounts to which the user has access. (accounts.list) |
|
| 245 | - * |
|
| 246 | - * @param array $optParams Optional parameters. |
|
| 247 | - * |
|
| 248 | - * @opt_param int max-results The maximum number of accounts to include in this response. |
|
| 249 | - * @opt_param int start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 250 | - * @return Google_Accounts |
|
| 251 | - */ |
|
| 252 | - public function listManagementAccounts($optParams = array()) { |
|
| 253 | - $params = array(); |
|
| 254 | - $params = array_merge($params, $optParams); |
|
| 255 | - $data = $this->__call('list', array($params)); |
|
| 256 | - if ($this->useObjects()) { |
|
| 257 | - return new Google_Accounts($data); |
|
| 258 | - } else { |
|
| 259 | - return $data; |
|
| 260 | - } |
|
| 261 | - } |
|
| 243 | + /** |
|
| 244 | + * Lists all accounts to which the user has access. (accounts.list) |
|
| 245 | + * |
|
| 246 | + * @param array $optParams Optional parameters. |
|
| 247 | + * |
|
| 248 | + * @opt_param int max-results The maximum number of accounts to include in this response. |
|
| 249 | + * @opt_param int start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 250 | + * @return Google_Accounts |
|
| 251 | + */ |
|
| 252 | + public function listManagementAccounts($optParams = array()) { |
|
| 253 | + $params = array(); |
|
| 254 | + $params = array_merge($params, $optParams); |
|
| 255 | + $data = $this->__call('list', array($params)); |
|
| 256 | + if ($this->useObjects()) { |
|
| 257 | + return new Google_Accounts($data); |
|
| 258 | + } else { |
|
| 259 | + return $data; |
|
| 260 | + } |
|
| 261 | + } |
|
| 262 | 262 | } |
| 263 | 263 | /** |
| 264 | 264 | * The "customDataSources" collection of methods. |
@@ -270,28 +270,28 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | class Google_ManagementCustomDataSourcesServiceResource extends Google_ServiceResource { |
| 272 | 272 | |
| 273 | - /** |
|
| 274 | - * List custom data sources to which the user has access. |
|
| 275 | - * (customDataSources.list) |
|
| 276 | - * |
|
| 277 | - * @param string $accountId Account Id for the custom data sources to retrieve. |
|
| 278 | - * @param string $webPropertyId Web property Id for the custom data sources to retrieve. |
|
| 279 | - * @param array $optParams Optional parameters. |
|
| 280 | - * |
|
| 281 | - * @opt_param int max-results The maximum number of custom data sources to include in this response. |
|
| 282 | - * @opt_param int start-index A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 283 | - * @return Google_CustomDataSources |
|
| 284 | - */ |
|
| 285 | - public function listManagementCustomDataSources($accountId, $webPropertyId, $optParams = array()) { |
|
| 286 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 287 | - $params = array_merge($params, $optParams); |
|
| 288 | - $data = $this->__call('list', array($params)); |
|
| 289 | - if ($this->useObjects()) { |
|
| 290 | - return new Google_CustomDataSources($data); |
|
| 291 | - } else { |
|
| 292 | - return $data; |
|
| 293 | - } |
|
| 294 | - } |
|
| 273 | + /** |
|
| 274 | + * List custom data sources to which the user has access. |
|
| 275 | + * (customDataSources.list) |
|
| 276 | + * |
|
| 277 | + * @param string $accountId Account Id for the custom data sources to retrieve. |
|
| 278 | + * @param string $webPropertyId Web property Id for the custom data sources to retrieve. |
|
| 279 | + * @param array $optParams Optional parameters. |
|
| 280 | + * |
|
| 281 | + * @opt_param int max-results The maximum number of custom data sources to include in this response. |
|
| 282 | + * @opt_param int start-index A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 283 | + * @return Google_CustomDataSources |
|
| 284 | + */ |
|
| 285 | + public function listManagementCustomDataSources($accountId, $webPropertyId, $optParams = array()) { |
|
| 286 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 287 | + $params = array_merge($params, $optParams); |
|
| 288 | + $data = $this->__call('list', array($params)); |
|
| 289 | + if ($this->useObjects()) { |
|
| 290 | + return new Google_CustomDataSources($data); |
|
| 291 | + } else { |
|
| 292 | + return $data; |
|
| 293 | + } |
|
| 294 | + } |
|
| 295 | 295 | } |
| 296 | 296 | /** |
| 297 | 297 | * The "dailyUploads" collection of methods. |
@@ -303,70 +303,70 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | class Google_ManagementDailyUploadsServiceResource extends Google_ServiceResource { |
| 305 | 305 | |
| 306 | - /** |
|
| 307 | - * Delete uploaded data for the given date. (dailyUploads.delete) |
|
| 308 | - * |
|
| 309 | - * @param string $accountId Account Id associated with daily upload delete. |
|
| 310 | - * @param string $webPropertyId Web property Id associated with daily upload delete. |
|
| 311 | - * @param string $customDataSourceId Custom data source Id associated with daily upload delete. |
|
| 312 | - * @param string $date Date for which data is to be deleted. Date should be formatted as YYYY-MM-DD. |
|
| 313 | - * @param string $type Type of data for this delete. |
|
| 314 | - * @param array $optParams Optional parameters. |
|
| 315 | - */ |
|
| 316 | - public function delete($accountId, $webPropertyId, $customDataSourceId, $date, $type, $optParams = array()) { |
|
| 317 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'date' => $date, 'type' => $type); |
|
| 318 | - $params = array_merge($params, $optParams); |
|
| 319 | - $data = $this->__call('delete', array($params)); |
|
| 320 | - return $data; |
|
| 321 | - } |
|
| 322 | - /** |
|
| 323 | - * List daily uploads to which the user has access. (dailyUploads.list) |
|
| 324 | - * |
|
| 325 | - * @param string $accountId Account Id for the daily uploads to retrieve. |
|
| 326 | - * @param string $webPropertyId Web property Id for the daily uploads to retrieve. |
|
| 327 | - * @param string $customDataSourceId Custom data source Id for daily uploads to retrieve. |
|
| 328 | - * @param string $start_date Start date of the form YYYY-MM-DD. |
|
| 329 | - * @param string $end_date End date of the form YYYY-MM-DD. |
|
| 330 | - * @param array $optParams Optional parameters. |
|
| 331 | - * |
|
| 332 | - * @opt_param int max-results The maximum number of custom data sources to include in this response. |
|
| 333 | - * @opt_param int start-index A 1-based index of the first daily upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 334 | - * @return Google_DailyUploads |
|
| 335 | - */ |
|
| 336 | - public function listManagementDailyUploads($accountId, $webPropertyId, $customDataSourceId, $start_date, $end_date, $optParams = array()) { |
|
| 337 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'start-date' => $start_date, 'end-date' => $end_date); |
|
| 338 | - $params = array_merge($params, $optParams); |
|
| 339 | - $data = $this->__call('list', array($params)); |
|
| 340 | - if ($this->useObjects()) { |
|
| 341 | - return new Google_DailyUploads($data); |
|
| 342 | - } else { |
|
| 343 | - return $data; |
|
| 344 | - } |
|
| 345 | - } |
|
| 346 | - /** |
|
| 347 | - * Update/Overwrite data for a custom data source. (dailyUploads.upload) |
|
| 348 | - * |
|
| 349 | - * @param string $accountId Account Id associated with daily upload. |
|
| 350 | - * @param string $webPropertyId Web property Id associated with daily upload. |
|
| 351 | - * @param string $customDataSourceId Custom data source Id to which the data being uploaded belongs. |
|
| 352 | - * @param string $date Date for which data is uploaded. Date should be formatted as YYYY-MM-DD. |
|
| 353 | - * @param int $appendNumber Append number for this upload indexed from 1. |
|
| 354 | - * @param string $type Type of data for this upload. |
|
| 355 | - * @param array $optParams Optional parameters. |
|
| 356 | - * |
|
| 357 | - * @opt_param bool reset Reset/Overwrite all previous appends for this date and start over with this file as the first upload. |
|
| 358 | - * @return Google_DailyUploadAppend |
|
| 359 | - */ |
|
| 360 | - public function upload($accountId, $webPropertyId, $customDataSourceId, $date, $appendNumber, $type, $optParams = array()) { |
|
| 361 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'date' => $date, 'appendNumber' => $appendNumber, 'type' => $type); |
|
| 362 | - $params = array_merge($params, $optParams); |
|
| 363 | - $data = $this->__call('upload', array($params)); |
|
| 364 | - if ($this->useObjects()) { |
|
| 365 | - return new Google_DailyUploadAppend($data); |
|
| 366 | - } else { |
|
| 367 | - return $data; |
|
| 368 | - } |
|
| 369 | - } |
|
| 306 | + /** |
|
| 307 | + * Delete uploaded data for the given date. (dailyUploads.delete) |
|
| 308 | + * |
|
| 309 | + * @param string $accountId Account Id associated with daily upload delete. |
|
| 310 | + * @param string $webPropertyId Web property Id associated with daily upload delete. |
|
| 311 | + * @param string $customDataSourceId Custom data source Id associated with daily upload delete. |
|
| 312 | + * @param string $date Date for which data is to be deleted. Date should be formatted as YYYY-MM-DD. |
|
| 313 | + * @param string $type Type of data for this delete. |
|
| 314 | + * @param array $optParams Optional parameters. |
|
| 315 | + */ |
|
| 316 | + public function delete($accountId, $webPropertyId, $customDataSourceId, $date, $type, $optParams = array()) { |
|
| 317 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'date' => $date, 'type' => $type); |
|
| 318 | + $params = array_merge($params, $optParams); |
|
| 319 | + $data = $this->__call('delete', array($params)); |
|
| 320 | + return $data; |
|
| 321 | + } |
|
| 322 | + /** |
|
| 323 | + * List daily uploads to which the user has access. (dailyUploads.list) |
|
| 324 | + * |
|
| 325 | + * @param string $accountId Account Id for the daily uploads to retrieve. |
|
| 326 | + * @param string $webPropertyId Web property Id for the daily uploads to retrieve. |
|
| 327 | + * @param string $customDataSourceId Custom data source Id for daily uploads to retrieve. |
|
| 328 | + * @param string $start_date Start date of the form YYYY-MM-DD. |
|
| 329 | + * @param string $end_date End date of the form YYYY-MM-DD. |
|
| 330 | + * @param array $optParams Optional parameters. |
|
| 331 | + * |
|
| 332 | + * @opt_param int max-results The maximum number of custom data sources to include in this response. |
|
| 333 | + * @opt_param int start-index A 1-based index of the first daily upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 334 | + * @return Google_DailyUploads |
|
| 335 | + */ |
|
| 336 | + public function listManagementDailyUploads($accountId, $webPropertyId, $customDataSourceId, $start_date, $end_date, $optParams = array()) { |
|
| 337 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'start-date' => $start_date, 'end-date' => $end_date); |
|
| 338 | + $params = array_merge($params, $optParams); |
|
| 339 | + $data = $this->__call('list', array($params)); |
|
| 340 | + if ($this->useObjects()) { |
|
| 341 | + return new Google_DailyUploads($data); |
|
| 342 | + } else { |
|
| 343 | + return $data; |
|
| 344 | + } |
|
| 345 | + } |
|
| 346 | + /** |
|
| 347 | + * Update/Overwrite data for a custom data source. (dailyUploads.upload) |
|
| 348 | + * |
|
| 349 | + * @param string $accountId Account Id associated with daily upload. |
|
| 350 | + * @param string $webPropertyId Web property Id associated with daily upload. |
|
| 351 | + * @param string $customDataSourceId Custom data source Id to which the data being uploaded belongs. |
|
| 352 | + * @param string $date Date for which data is uploaded. Date should be formatted as YYYY-MM-DD. |
|
| 353 | + * @param int $appendNumber Append number for this upload indexed from 1. |
|
| 354 | + * @param string $type Type of data for this upload. |
|
| 355 | + * @param array $optParams Optional parameters. |
|
| 356 | + * |
|
| 357 | + * @opt_param bool reset Reset/Overwrite all previous appends for this date and start over with this file as the first upload. |
|
| 358 | + * @return Google_DailyUploadAppend |
|
| 359 | + */ |
|
| 360 | + public function upload($accountId, $webPropertyId, $customDataSourceId, $date, $appendNumber, $type, $optParams = array()) { |
|
| 361 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'date' => $date, 'appendNumber' => $appendNumber, 'type' => $type); |
|
| 362 | + $params = array_merge($params, $optParams); |
|
| 363 | + $data = $this->__call('upload', array($params)); |
|
| 364 | + if ($this->useObjects()) { |
|
| 365 | + return new Google_DailyUploadAppend($data); |
|
| 366 | + } else { |
|
| 367 | + return $data; |
|
| 368 | + } |
|
| 369 | + } |
|
| 370 | 370 | } |
| 371 | 371 | /** |
| 372 | 372 | * The "experiments" collection of methods. |
@@ -378,126 +378,126 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | class Google_ManagementExperimentsServiceResource extends Google_ServiceResource { |
| 380 | 380 | |
| 381 | - /** |
|
| 382 | - * Delete an experiment. (experiments.delete) |
|
| 383 | - * |
|
| 384 | - * @param string $accountId Account ID to which the experiment belongs |
|
| 385 | - * @param string $webPropertyId Web property ID to which the experiment belongs |
|
| 386 | - * @param string $profileId View (Profile) ID to which the experiment belongs |
|
| 387 | - * @param string $experimentId ID of the experiment to delete |
|
| 388 | - * @param array $optParams Optional parameters. |
|
| 389 | - */ |
|
| 390 | - public function delete($accountId, $webPropertyId, $profileId, $experimentId, $optParams = array()) { |
|
| 391 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId); |
|
| 392 | - $params = array_merge($params, $optParams); |
|
| 393 | - $data = $this->__call('delete', array($params)); |
|
| 394 | - return $data; |
|
| 395 | - } |
|
| 396 | - /** |
|
| 397 | - * Returns an experiment to which the user has access. (experiments.get) |
|
| 398 | - * |
|
| 399 | - * @param string $accountId Account ID to retrieve the experiment for. |
|
| 400 | - * @param string $webPropertyId Web property ID to retrieve the experiment for. |
|
| 401 | - * @param string $profileId View (Profile) ID to retrieve the experiment for. |
|
| 402 | - * @param string $experimentId Experiment ID to retrieve the experiment for. |
|
| 403 | - * @param array $optParams Optional parameters. |
|
| 404 | - * @return Google_Experiment |
|
| 405 | - */ |
|
| 406 | - public function get($accountId, $webPropertyId, $profileId, $experimentId, $optParams = array()) { |
|
| 407 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId); |
|
| 408 | - $params = array_merge($params, $optParams); |
|
| 409 | - $data = $this->__call('get', array($params)); |
|
| 410 | - if ($this->useObjects()) { |
|
| 411 | - return new Google_Experiment($data); |
|
| 412 | - } else { |
|
| 413 | - return $data; |
|
| 414 | - } |
|
| 415 | - } |
|
| 416 | - /** |
|
| 417 | - * Create a new experiment. (experiments.insert) |
|
| 418 | - * |
|
| 419 | - * @param string $accountId Account ID to create the experiment for. |
|
| 420 | - * @param string $webPropertyId Web property ID to create the experiment for. |
|
| 421 | - * @param string $profileId View (Profile) ID to create the experiment for. |
|
| 422 | - * @param Google_Experiment $postBody |
|
| 423 | - * @param array $optParams Optional parameters. |
|
| 424 | - * @return Google_Experiment |
|
| 425 | - */ |
|
| 426 | - public function insert($accountId, $webPropertyId, $profileId, Google_Experiment $postBody, $optParams = array()) { |
|
| 427 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 428 | - $params = array_merge($params, $optParams); |
|
| 429 | - $data = $this->__call('insert', array($params)); |
|
| 430 | - if ($this->useObjects()) { |
|
| 431 | - return new Google_Experiment($data); |
|
| 432 | - } else { |
|
| 433 | - return $data; |
|
| 434 | - } |
|
| 435 | - } |
|
| 436 | - /** |
|
| 437 | - * Lists experiments to which the user has access. (experiments.list) |
|
| 438 | - * |
|
| 439 | - * @param string $accountId Account ID to retrieve experiments for. |
|
| 440 | - * @param string $webPropertyId Web property ID to retrieve experiments for. |
|
| 441 | - * @param string $profileId View (Profile) ID to retrieve experiments for. |
|
| 442 | - * @param array $optParams Optional parameters. |
|
| 443 | - * |
|
| 444 | - * @opt_param int max-results The maximum number of experiments to include in this response. |
|
| 445 | - * @opt_param int start-index An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 446 | - * @return Google_Experiments |
|
| 447 | - */ |
|
| 448 | - public function listManagementExperiments($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 449 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 450 | - $params = array_merge($params, $optParams); |
|
| 451 | - $data = $this->__call('list', array($params)); |
|
| 452 | - if ($this->useObjects()) { |
|
| 453 | - return new Google_Experiments($data); |
|
| 454 | - } else { |
|
| 455 | - return $data; |
|
| 456 | - } |
|
| 457 | - } |
|
| 458 | - /** |
|
| 459 | - * Update an existing experiment. This method supports patch semantics. |
|
| 460 | - * (experiments.patch) |
|
| 461 | - * |
|
| 462 | - * @param string $accountId Account ID of the experiment to update. |
|
| 463 | - * @param string $webPropertyId Web property ID of the experiment to update. |
|
| 464 | - * @param string $profileId View (Profile) ID of the experiment to update. |
|
| 465 | - * @param string $experimentId Experiment ID of the experiment to update. |
|
| 466 | - * @param Google_Experiment $postBody |
|
| 467 | - * @param array $optParams Optional parameters. |
|
| 468 | - * @return Google_Experiment |
|
| 469 | - */ |
|
| 470 | - public function patch($accountId, $webPropertyId, $profileId, $experimentId, Google_Experiment $postBody, $optParams = array()) { |
|
| 471 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody); |
|
| 472 | - $params = array_merge($params, $optParams); |
|
| 473 | - $data = $this->__call('patch', array($params)); |
|
| 474 | - if ($this->useObjects()) { |
|
| 475 | - return new Google_Experiment($data); |
|
| 476 | - } else { |
|
| 477 | - return $data; |
|
| 478 | - } |
|
| 479 | - } |
|
| 480 | - /** |
|
| 481 | - * Update an existing experiment. (experiments.update) |
|
| 482 | - * |
|
| 483 | - * @param string $accountId Account ID of the experiment to update. |
|
| 484 | - * @param string $webPropertyId Web property ID of the experiment to update. |
|
| 485 | - * @param string $profileId View (Profile) ID of the experiment to update. |
|
| 486 | - * @param string $experimentId Experiment ID of the experiment to update. |
|
| 487 | - * @param Google_Experiment $postBody |
|
| 488 | - * @param array $optParams Optional parameters. |
|
| 489 | - * @return Google_Experiment |
|
| 490 | - */ |
|
| 491 | - public function update($accountId, $webPropertyId, $profileId, $experimentId, Google_Experiment $postBody, $optParams = array()) { |
|
| 492 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody); |
|
| 493 | - $params = array_merge($params, $optParams); |
|
| 494 | - $data = $this->__call('update', array($params)); |
|
| 495 | - if ($this->useObjects()) { |
|
| 496 | - return new Google_Experiment($data); |
|
| 497 | - } else { |
|
| 498 | - return $data; |
|
| 499 | - } |
|
| 500 | - } |
|
| 381 | + /** |
|
| 382 | + * Delete an experiment. (experiments.delete) |
|
| 383 | + * |
|
| 384 | + * @param string $accountId Account ID to which the experiment belongs |
|
| 385 | + * @param string $webPropertyId Web property ID to which the experiment belongs |
|
| 386 | + * @param string $profileId View (Profile) ID to which the experiment belongs |
|
| 387 | + * @param string $experimentId ID of the experiment to delete |
|
| 388 | + * @param array $optParams Optional parameters. |
|
| 389 | + */ |
|
| 390 | + public function delete($accountId, $webPropertyId, $profileId, $experimentId, $optParams = array()) { |
|
| 391 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId); |
|
| 392 | + $params = array_merge($params, $optParams); |
|
| 393 | + $data = $this->__call('delete', array($params)); |
|
| 394 | + return $data; |
|
| 395 | + } |
|
| 396 | + /** |
|
| 397 | + * Returns an experiment to which the user has access. (experiments.get) |
|
| 398 | + * |
|
| 399 | + * @param string $accountId Account ID to retrieve the experiment for. |
|
| 400 | + * @param string $webPropertyId Web property ID to retrieve the experiment for. |
|
| 401 | + * @param string $profileId View (Profile) ID to retrieve the experiment for. |
|
| 402 | + * @param string $experimentId Experiment ID to retrieve the experiment for. |
|
| 403 | + * @param array $optParams Optional parameters. |
|
| 404 | + * @return Google_Experiment |
|
| 405 | + */ |
|
| 406 | + public function get($accountId, $webPropertyId, $profileId, $experimentId, $optParams = array()) { |
|
| 407 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId); |
|
| 408 | + $params = array_merge($params, $optParams); |
|
| 409 | + $data = $this->__call('get', array($params)); |
|
| 410 | + if ($this->useObjects()) { |
|
| 411 | + return new Google_Experiment($data); |
|
| 412 | + } else { |
|
| 413 | + return $data; |
|
| 414 | + } |
|
| 415 | + } |
|
| 416 | + /** |
|
| 417 | + * Create a new experiment. (experiments.insert) |
|
| 418 | + * |
|
| 419 | + * @param string $accountId Account ID to create the experiment for. |
|
| 420 | + * @param string $webPropertyId Web property ID to create the experiment for. |
|
| 421 | + * @param string $profileId View (Profile) ID to create the experiment for. |
|
| 422 | + * @param Google_Experiment $postBody |
|
| 423 | + * @param array $optParams Optional parameters. |
|
| 424 | + * @return Google_Experiment |
|
| 425 | + */ |
|
| 426 | + public function insert($accountId, $webPropertyId, $profileId, Google_Experiment $postBody, $optParams = array()) { |
|
| 427 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 428 | + $params = array_merge($params, $optParams); |
|
| 429 | + $data = $this->__call('insert', array($params)); |
|
| 430 | + if ($this->useObjects()) { |
|
| 431 | + return new Google_Experiment($data); |
|
| 432 | + } else { |
|
| 433 | + return $data; |
|
| 434 | + } |
|
| 435 | + } |
|
| 436 | + /** |
|
| 437 | + * Lists experiments to which the user has access. (experiments.list) |
|
| 438 | + * |
|
| 439 | + * @param string $accountId Account ID to retrieve experiments for. |
|
| 440 | + * @param string $webPropertyId Web property ID to retrieve experiments for. |
|
| 441 | + * @param string $profileId View (Profile) ID to retrieve experiments for. |
|
| 442 | + * @param array $optParams Optional parameters. |
|
| 443 | + * |
|
| 444 | + * @opt_param int max-results The maximum number of experiments to include in this response. |
|
| 445 | + * @opt_param int start-index An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 446 | + * @return Google_Experiments |
|
| 447 | + */ |
|
| 448 | + public function listManagementExperiments($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 449 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 450 | + $params = array_merge($params, $optParams); |
|
| 451 | + $data = $this->__call('list', array($params)); |
|
| 452 | + if ($this->useObjects()) { |
|
| 453 | + return new Google_Experiments($data); |
|
| 454 | + } else { |
|
| 455 | + return $data; |
|
| 456 | + } |
|
| 457 | + } |
|
| 458 | + /** |
|
| 459 | + * Update an existing experiment. This method supports patch semantics. |
|
| 460 | + * (experiments.patch) |
|
| 461 | + * |
|
| 462 | + * @param string $accountId Account ID of the experiment to update. |
|
| 463 | + * @param string $webPropertyId Web property ID of the experiment to update. |
|
| 464 | + * @param string $profileId View (Profile) ID of the experiment to update. |
|
| 465 | + * @param string $experimentId Experiment ID of the experiment to update. |
|
| 466 | + * @param Google_Experiment $postBody |
|
| 467 | + * @param array $optParams Optional parameters. |
|
| 468 | + * @return Google_Experiment |
|
| 469 | + */ |
|
| 470 | + public function patch($accountId, $webPropertyId, $profileId, $experimentId, Google_Experiment $postBody, $optParams = array()) { |
|
| 471 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody); |
|
| 472 | + $params = array_merge($params, $optParams); |
|
| 473 | + $data = $this->__call('patch', array($params)); |
|
| 474 | + if ($this->useObjects()) { |
|
| 475 | + return new Google_Experiment($data); |
|
| 476 | + } else { |
|
| 477 | + return $data; |
|
| 478 | + } |
|
| 479 | + } |
|
| 480 | + /** |
|
| 481 | + * Update an existing experiment. (experiments.update) |
|
| 482 | + * |
|
| 483 | + * @param string $accountId Account ID of the experiment to update. |
|
| 484 | + * @param string $webPropertyId Web property ID of the experiment to update. |
|
| 485 | + * @param string $profileId View (Profile) ID of the experiment to update. |
|
| 486 | + * @param string $experimentId Experiment ID of the experiment to update. |
|
| 487 | + * @param Google_Experiment $postBody |
|
| 488 | + * @param array $optParams Optional parameters. |
|
| 489 | + * @return Google_Experiment |
|
| 490 | + */ |
|
| 491 | + public function update($accountId, $webPropertyId, $profileId, $experimentId, Google_Experiment $postBody, $optParams = array()) { |
|
| 492 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody); |
|
| 493 | + $params = array_merge($params, $optParams); |
|
| 494 | + $data = $this->__call('update', array($params)); |
|
| 495 | + if ($this->useObjects()) { |
|
| 496 | + return new Google_Experiment($data); |
|
| 497 | + } else { |
|
| 498 | + return $data; |
|
| 499 | + } |
|
| 500 | + } |
|
| 501 | 501 | } |
| 502 | 502 | /** |
| 503 | 503 | * The "goals" collection of methods. |
@@ -509,111 +509,111 @@ discard block |
||
| 509 | 509 | */ |
| 510 | 510 | class Google_ManagementGoalsServiceResource extends Google_ServiceResource { |
| 511 | 511 | |
| 512 | - /** |
|
| 513 | - * Gets a goal to which the user has access. (goals.get) |
|
| 514 | - * |
|
| 515 | - * @param string $accountId Account ID to retrieve the goal for. |
|
| 516 | - * @param string $webPropertyId Web property ID to retrieve the goal for. |
|
| 517 | - * @param string $profileId View (Profile) ID to retrieve the goal for. |
|
| 518 | - * @param string $goalId Goal ID to retrieve the goal for. |
|
| 519 | - * @param array $optParams Optional parameters. |
|
| 520 | - * @return Google_Goal |
|
| 521 | - */ |
|
| 522 | - public function get($accountId, $webPropertyId, $profileId, $goalId, $optParams = array()) { |
|
| 523 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId); |
|
| 524 | - $params = array_merge($params, $optParams); |
|
| 525 | - $data = $this->__call('get', array($params)); |
|
| 526 | - if ($this->useObjects()) { |
|
| 527 | - return new Google_Goal($data); |
|
| 528 | - } else { |
|
| 529 | - return $data; |
|
| 530 | - } |
|
| 531 | - } |
|
| 532 | - /** |
|
| 533 | - * Create a new goal. (goals.insert) |
|
| 534 | - * |
|
| 535 | - * @param string $accountId Account ID to create the goal for. |
|
| 536 | - * @param string $webPropertyId Web property ID to create the goal for. |
|
| 537 | - * @param string $profileId View (Profile) ID to create the goal for. |
|
| 538 | - * @param Google_Goal $postBody |
|
| 539 | - * @param array $optParams Optional parameters. |
|
| 540 | - * @return Google_Goal |
|
| 541 | - */ |
|
| 542 | - public function insert($accountId, $webPropertyId, $profileId, Google_Goal $postBody, $optParams = array()) { |
|
| 543 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 544 | - $params = array_merge($params, $optParams); |
|
| 545 | - $data = $this->__call('insert', array($params)); |
|
| 546 | - if ($this->useObjects()) { |
|
| 547 | - return new Google_Goal($data); |
|
| 548 | - } else { |
|
| 549 | - return $data; |
|
| 550 | - } |
|
| 551 | - } |
|
| 552 | - /** |
|
| 553 | - * Lists goals to which the user has access. (goals.list) |
|
| 554 | - * |
|
| 555 | - * @param string $accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. |
|
| 556 | - * @param string $webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. |
|
| 557 | - * @param string $profileId View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. |
|
| 558 | - * @param array $optParams Optional parameters. |
|
| 559 | - * |
|
| 560 | - * @opt_param int max-results The maximum number of goals to include in this response. |
|
| 561 | - * @opt_param int start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 562 | - * @return Google_Goals |
|
| 563 | - */ |
|
| 564 | - public function listManagementGoals($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 565 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 566 | - $params = array_merge($params, $optParams); |
|
| 567 | - $data = $this->__call('list', array($params)); |
|
| 568 | - if ($this->useObjects()) { |
|
| 569 | - return new Google_Goals($data); |
|
| 570 | - } else { |
|
| 571 | - return $data; |
|
| 572 | - } |
|
| 573 | - } |
|
| 574 | - /** |
|
| 575 | - * Updates an existing view (profile). This method supports patch semantics. |
|
| 576 | - * (goals.patch) |
|
| 577 | - * |
|
| 578 | - * @param string $accountId Account ID to update the goal. |
|
| 579 | - * @param string $webPropertyId Web property ID to update the goal. |
|
| 580 | - * @param string $profileId View (Profile) ID to update the goal. |
|
| 581 | - * @param string $goalId Index of the goal to be updated. |
|
| 582 | - * @param Google_Goal $postBody |
|
| 583 | - * @param array $optParams Optional parameters. |
|
| 584 | - * @return Google_Goal |
|
| 585 | - */ |
|
| 586 | - public function patch($accountId, $webPropertyId, $profileId, $goalId, Google_Goal $postBody, $optParams = array()) { |
|
| 587 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody); |
|
| 588 | - $params = array_merge($params, $optParams); |
|
| 589 | - $data = $this->__call('patch', array($params)); |
|
| 590 | - if ($this->useObjects()) { |
|
| 591 | - return new Google_Goal($data); |
|
| 592 | - } else { |
|
| 593 | - return $data; |
|
| 594 | - } |
|
| 595 | - } |
|
| 596 | - /** |
|
| 597 | - * Updates an existing view (profile). (goals.update) |
|
| 598 | - * |
|
| 599 | - * @param string $accountId Account ID to update the goal. |
|
| 600 | - * @param string $webPropertyId Web property ID to update the goal. |
|
| 601 | - * @param string $profileId View (Profile) ID to update the goal. |
|
| 602 | - * @param string $goalId Index of the goal to be updated. |
|
| 603 | - * @param Google_Goal $postBody |
|
| 604 | - * @param array $optParams Optional parameters. |
|
| 605 | - * @return Google_Goal |
|
| 606 | - */ |
|
| 607 | - public function update($accountId, $webPropertyId, $profileId, $goalId, Google_Goal $postBody, $optParams = array()) { |
|
| 608 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody); |
|
| 609 | - $params = array_merge($params, $optParams); |
|
| 610 | - $data = $this->__call('update', array($params)); |
|
| 611 | - if ($this->useObjects()) { |
|
| 612 | - return new Google_Goal($data); |
|
| 613 | - } else { |
|
| 614 | - return $data; |
|
| 615 | - } |
|
| 616 | - } |
|
| 512 | + /** |
|
| 513 | + * Gets a goal to which the user has access. (goals.get) |
|
| 514 | + * |
|
| 515 | + * @param string $accountId Account ID to retrieve the goal for. |
|
| 516 | + * @param string $webPropertyId Web property ID to retrieve the goal for. |
|
| 517 | + * @param string $profileId View (Profile) ID to retrieve the goal for. |
|
| 518 | + * @param string $goalId Goal ID to retrieve the goal for. |
|
| 519 | + * @param array $optParams Optional parameters. |
|
| 520 | + * @return Google_Goal |
|
| 521 | + */ |
|
| 522 | + public function get($accountId, $webPropertyId, $profileId, $goalId, $optParams = array()) { |
|
| 523 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId); |
|
| 524 | + $params = array_merge($params, $optParams); |
|
| 525 | + $data = $this->__call('get', array($params)); |
|
| 526 | + if ($this->useObjects()) { |
|
| 527 | + return new Google_Goal($data); |
|
| 528 | + } else { |
|
| 529 | + return $data; |
|
| 530 | + } |
|
| 531 | + } |
|
| 532 | + /** |
|
| 533 | + * Create a new goal. (goals.insert) |
|
| 534 | + * |
|
| 535 | + * @param string $accountId Account ID to create the goal for. |
|
| 536 | + * @param string $webPropertyId Web property ID to create the goal for. |
|
| 537 | + * @param string $profileId View (Profile) ID to create the goal for. |
|
| 538 | + * @param Google_Goal $postBody |
|
| 539 | + * @param array $optParams Optional parameters. |
|
| 540 | + * @return Google_Goal |
|
| 541 | + */ |
|
| 542 | + public function insert($accountId, $webPropertyId, $profileId, Google_Goal $postBody, $optParams = array()) { |
|
| 543 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 544 | + $params = array_merge($params, $optParams); |
|
| 545 | + $data = $this->__call('insert', array($params)); |
|
| 546 | + if ($this->useObjects()) { |
|
| 547 | + return new Google_Goal($data); |
|
| 548 | + } else { |
|
| 549 | + return $data; |
|
| 550 | + } |
|
| 551 | + } |
|
| 552 | + /** |
|
| 553 | + * Lists goals to which the user has access. (goals.list) |
|
| 554 | + * |
|
| 555 | + * @param string $accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. |
|
| 556 | + * @param string $webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. |
|
| 557 | + * @param string $profileId View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. |
|
| 558 | + * @param array $optParams Optional parameters. |
|
| 559 | + * |
|
| 560 | + * @opt_param int max-results The maximum number of goals to include in this response. |
|
| 561 | + * @opt_param int start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 562 | + * @return Google_Goals |
|
| 563 | + */ |
|
| 564 | + public function listManagementGoals($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 565 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 566 | + $params = array_merge($params, $optParams); |
|
| 567 | + $data = $this->__call('list', array($params)); |
|
| 568 | + if ($this->useObjects()) { |
|
| 569 | + return new Google_Goals($data); |
|
| 570 | + } else { |
|
| 571 | + return $data; |
|
| 572 | + } |
|
| 573 | + } |
|
| 574 | + /** |
|
| 575 | + * Updates an existing view (profile). This method supports patch semantics. |
|
| 576 | + * (goals.patch) |
|
| 577 | + * |
|
| 578 | + * @param string $accountId Account ID to update the goal. |
|
| 579 | + * @param string $webPropertyId Web property ID to update the goal. |
|
| 580 | + * @param string $profileId View (Profile) ID to update the goal. |
|
| 581 | + * @param string $goalId Index of the goal to be updated. |
|
| 582 | + * @param Google_Goal $postBody |
|
| 583 | + * @param array $optParams Optional parameters. |
|
| 584 | + * @return Google_Goal |
|
| 585 | + */ |
|
| 586 | + public function patch($accountId, $webPropertyId, $profileId, $goalId, Google_Goal $postBody, $optParams = array()) { |
|
| 587 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody); |
|
| 588 | + $params = array_merge($params, $optParams); |
|
| 589 | + $data = $this->__call('patch', array($params)); |
|
| 590 | + if ($this->useObjects()) { |
|
| 591 | + return new Google_Goal($data); |
|
| 592 | + } else { |
|
| 593 | + return $data; |
|
| 594 | + } |
|
| 595 | + } |
|
| 596 | + /** |
|
| 597 | + * Updates an existing view (profile). (goals.update) |
|
| 598 | + * |
|
| 599 | + * @param string $accountId Account ID to update the goal. |
|
| 600 | + * @param string $webPropertyId Web property ID to update the goal. |
|
| 601 | + * @param string $profileId View (Profile) ID to update the goal. |
|
| 602 | + * @param string $goalId Index of the goal to be updated. |
|
| 603 | + * @param Google_Goal $postBody |
|
| 604 | + * @param array $optParams Optional parameters. |
|
| 605 | + * @return Google_Goal |
|
| 606 | + */ |
|
| 607 | + public function update($accountId, $webPropertyId, $profileId, $goalId, Google_Goal $postBody, $optParams = array()) { |
|
| 608 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody); |
|
| 609 | + $params = array_merge($params, $optParams); |
|
| 610 | + $data = $this->__call('update', array($params)); |
|
| 611 | + if ($this->useObjects()) { |
|
| 612 | + return new Google_Goal($data); |
|
| 613 | + } else { |
|
| 614 | + return $data; |
|
| 615 | + } |
|
| 616 | + } |
|
| 617 | 617 | } |
| 618 | 618 | /** |
| 619 | 619 | * The "profileUserLinks" collection of methods. |
@@ -625,85 +625,85 @@ discard block |
||
| 625 | 625 | */ |
| 626 | 626 | class Google_ManagementProfileUserLinksServiceResource extends Google_ServiceResource { |
| 627 | 627 | |
| 628 | - /** |
|
| 629 | - * Removes a user from the given view (profile). (profileUserLinks.delete) |
|
| 630 | - * |
|
| 631 | - * @param string $accountId Account ID to delete the user link for. |
|
| 632 | - * @param string $webPropertyId Web Property ID to delete the user link for. |
|
| 633 | - * @param string $profileId View (Profile) ID to delete the user link for. |
|
| 634 | - * @param string $linkId Link ID to delete the user link for. |
|
| 635 | - * @param array $optParams Optional parameters. |
|
| 636 | - */ |
|
| 637 | - public function delete($accountId, $webPropertyId, $profileId, $linkId, $optParams = array()) { |
|
| 638 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId); |
|
| 639 | - $params = array_merge($params, $optParams); |
|
| 640 | - $data = $this->__call('delete', array($params)); |
|
| 641 | - return $data; |
|
| 642 | - } |
|
| 643 | - /** |
|
| 644 | - * Adds a new user to the given view (profile). (profileUserLinks.insert) |
|
| 645 | - * |
|
| 646 | - * @param string $accountId Account ID to create the user link for. |
|
| 647 | - * @param string $webPropertyId Web Property ID to create the user link for. |
|
| 648 | - * @param string $profileId View (Profile) ID to create the user link for. |
|
| 649 | - * @param Google_EntityUserLink $postBody |
|
| 650 | - * @param array $optParams Optional parameters. |
|
| 651 | - * @return Google_EntityUserLink |
|
| 652 | - */ |
|
| 653 | - public function insert($accountId, $webPropertyId, $profileId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 654 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 655 | - $params = array_merge($params, $optParams); |
|
| 656 | - $data = $this->__call('insert', array($params)); |
|
| 657 | - if ($this->useObjects()) { |
|
| 658 | - return new Google_EntityUserLink($data); |
|
| 659 | - } else { |
|
| 660 | - return $data; |
|
| 661 | - } |
|
| 662 | - } |
|
| 663 | - /** |
|
| 664 | - * Lists profile-user links for a given view (profile). (profileUserLinks.list) |
|
| 665 | - * |
|
| 666 | - * @param string $accountId Account ID which the given view (profile) belongs to. |
|
| 667 | - * @param string $webPropertyId Web Property ID which the given view (profile) belongs to. |
|
| 668 | - * @param string $profileId View (Profile) ID to retrieve the profile-user links for |
|
| 669 | - * @param array $optParams Optional parameters. |
|
| 670 | - * |
|
| 671 | - * @opt_param int max-results The maximum number of profile-user links to include in this response. |
|
| 672 | - * @opt_param int start-index An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 673 | - * @return Google_EntityUserLinks |
|
| 674 | - */ |
|
| 675 | - public function listManagementProfileUserLinks($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 676 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 677 | - $params = array_merge($params, $optParams); |
|
| 678 | - $data = $this->__call('list', array($params)); |
|
| 679 | - if ($this->useObjects()) { |
|
| 680 | - return new Google_EntityUserLinks($data); |
|
| 681 | - } else { |
|
| 682 | - return $data; |
|
| 683 | - } |
|
| 684 | - } |
|
| 685 | - /** |
|
| 686 | - * Updates permissions for an existing user on the given view (profile). |
|
| 687 | - * (profileUserLinks.update) |
|
| 688 | - * |
|
| 689 | - * @param string $accountId Account ID to update the user link for. |
|
| 690 | - * @param string $webPropertyId Web Property ID to update the user link for. |
|
| 691 | - * @param string $profileId View (Profile ID) to update the user link for. |
|
| 692 | - * @param string $linkId Link ID to update the user link for. |
|
| 693 | - * @param Google_EntityUserLink $postBody |
|
| 694 | - * @param array $optParams Optional parameters. |
|
| 695 | - * @return Google_EntityUserLink |
|
| 696 | - */ |
|
| 697 | - public function update($accountId, $webPropertyId, $profileId, $linkId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 698 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody); |
|
| 699 | - $params = array_merge($params, $optParams); |
|
| 700 | - $data = $this->__call('update', array($params)); |
|
| 701 | - if ($this->useObjects()) { |
|
| 702 | - return new Google_EntityUserLink($data); |
|
| 703 | - } else { |
|
| 704 | - return $data; |
|
| 705 | - } |
|
| 706 | - } |
|
| 628 | + /** |
|
| 629 | + * Removes a user from the given view (profile). (profileUserLinks.delete) |
|
| 630 | + * |
|
| 631 | + * @param string $accountId Account ID to delete the user link for. |
|
| 632 | + * @param string $webPropertyId Web Property ID to delete the user link for. |
|
| 633 | + * @param string $profileId View (Profile) ID to delete the user link for. |
|
| 634 | + * @param string $linkId Link ID to delete the user link for. |
|
| 635 | + * @param array $optParams Optional parameters. |
|
| 636 | + */ |
|
| 637 | + public function delete($accountId, $webPropertyId, $profileId, $linkId, $optParams = array()) { |
|
| 638 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId); |
|
| 639 | + $params = array_merge($params, $optParams); |
|
| 640 | + $data = $this->__call('delete', array($params)); |
|
| 641 | + return $data; |
|
| 642 | + } |
|
| 643 | + /** |
|
| 644 | + * Adds a new user to the given view (profile). (profileUserLinks.insert) |
|
| 645 | + * |
|
| 646 | + * @param string $accountId Account ID to create the user link for. |
|
| 647 | + * @param string $webPropertyId Web Property ID to create the user link for. |
|
| 648 | + * @param string $profileId View (Profile) ID to create the user link for. |
|
| 649 | + * @param Google_EntityUserLink $postBody |
|
| 650 | + * @param array $optParams Optional parameters. |
|
| 651 | + * @return Google_EntityUserLink |
|
| 652 | + */ |
|
| 653 | + public function insert($accountId, $webPropertyId, $profileId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 654 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 655 | + $params = array_merge($params, $optParams); |
|
| 656 | + $data = $this->__call('insert', array($params)); |
|
| 657 | + if ($this->useObjects()) { |
|
| 658 | + return new Google_EntityUserLink($data); |
|
| 659 | + } else { |
|
| 660 | + return $data; |
|
| 661 | + } |
|
| 662 | + } |
|
| 663 | + /** |
|
| 664 | + * Lists profile-user links for a given view (profile). (profileUserLinks.list) |
|
| 665 | + * |
|
| 666 | + * @param string $accountId Account ID which the given view (profile) belongs to. |
|
| 667 | + * @param string $webPropertyId Web Property ID which the given view (profile) belongs to. |
|
| 668 | + * @param string $profileId View (Profile) ID to retrieve the profile-user links for |
|
| 669 | + * @param array $optParams Optional parameters. |
|
| 670 | + * |
|
| 671 | + * @opt_param int max-results The maximum number of profile-user links to include in this response. |
|
| 672 | + * @opt_param int start-index An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 673 | + * @return Google_EntityUserLinks |
|
| 674 | + */ |
|
| 675 | + public function listManagementProfileUserLinks($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 676 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 677 | + $params = array_merge($params, $optParams); |
|
| 678 | + $data = $this->__call('list', array($params)); |
|
| 679 | + if ($this->useObjects()) { |
|
| 680 | + return new Google_EntityUserLinks($data); |
|
| 681 | + } else { |
|
| 682 | + return $data; |
|
| 683 | + } |
|
| 684 | + } |
|
| 685 | + /** |
|
| 686 | + * Updates permissions for an existing user on the given view (profile). |
|
| 687 | + * (profileUserLinks.update) |
|
| 688 | + * |
|
| 689 | + * @param string $accountId Account ID to update the user link for. |
|
| 690 | + * @param string $webPropertyId Web Property ID to update the user link for. |
|
| 691 | + * @param string $profileId View (Profile ID) to update the user link for. |
|
| 692 | + * @param string $linkId Link ID to update the user link for. |
|
| 693 | + * @param Google_EntityUserLink $postBody |
|
| 694 | + * @param array $optParams Optional parameters. |
|
| 695 | + * @return Google_EntityUserLink |
|
| 696 | + */ |
|
| 697 | + public function update($accountId, $webPropertyId, $profileId, $linkId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 698 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody); |
|
| 699 | + $params = array_merge($params, $optParams); |
|
| 700 | + $data = $this->__call('update', array($params)); |
|
| 701 | + if ($this->useObjects()) { |
|
| 702 | + return new Google_EntityUserLink($data); |
|
| 703 | + } else { |
|
| 704 | + return $data; |
|
| 705 | + } |
|
| 706 | + } |
|
| 707 | 707 | } |
| 708 | 708 | /** |
| 709 | 709 | * The "profiles" collection of methods. |
@@ -715,120 +715,120 @@ discard block |
||
| 715 | 715 | */ |
| 716 | 716 | class Google_ManagementProfilesServiceResource extends Google_ServiceResource { |
| 717 | 717 | |
| 718 | - /** |
|
| 719 | - * Deletes a view (profile). (profiles.delete) |
|
| 720 | - * |
|
| 721 | - * @param string $accountId Account ID to delete the view (profile) for. |
|
| 722 | - * @param string $webPropertyId Web property ID to delete the view (profile) for. |
|
| 723 | - * @param string $profileId ID of the view (profile) to be deleted. |
|
| 724 | - * @param array $optParams Optional parameters. |
|
| 725 | - */ |
|
| 726 | - public function delete($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 727 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 728 | - $params = array_merge($params, $optParams); |
|
| 729 | - $data = $this->__call('delete', array($params)); |
|
| 730 | - return $data; |
|
| 731 | - } |
|
| 732 | - /** |
|
| 733 | - * Gets a view (profile) to which the user has access. (profiles.get) |
|
| 734 | - * |
|
| 735 | - * @param string $accountId Account ID to retrieve the goal for. |
|
| 736 | - * @param string $webPropertyId Web property ID to retrieve the goal for. |
|
| 737 | - * @param string $profileId View (Profile) ID to retrieve the goal for. |
|
| 738 | - * @param array $optParams Optional parameters. |
|
| 739 | - * @return Google_Profile |
|
| 740 | - */ |
|
| 741 | - public function get($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 742 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 743 | - $params = array_merge($params, $optParams); |
|
| 744 | - $data = $this->__call('get', array($params)); |
|
| 745 | - if ($this->useObjects()) { |
|
| 746 | - return new Google_Profile($data); |
|
| 747 | - } else { |
|
| 748 | - return $data; |
|
| 749 | - } |
|
| 750 | - } |
|
| 751 | - /** |
|
| 752 | - * Create a new view (profile). (profiles.insert) |
|
| 753 | - * |
|
| 754 | - * @param string $accountId Account ID to create the view (profile) for. |
|
| 755 | - * @param string $webPropertyId Web property ID to create the view (profile) for. |
|
| 756 | - * @param Google_Profile $postBody |
|
| 757 | - * @param array $optParams Optional parameters. |
|
| 758 | - * @return Google_Profile |
|
| 759 | - */ |
|
| 760 | - public function insert($accountId, $webPropertyId, Google_Profile $postBody, $optParams = array()) { |
|
| 761 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 762 | - $params = array_merge($params, $optParams); |
|
| 763 | - $data = $this->__call('insert', array($params)); |
|
| 764 | - if ($this->useObjects()) { |
|
| 765 | - return new Google_Profile($data); |
|
| 766 | - } else { |
|
| 767 | - return $data; |
|
| 768 | - } |
|
| 769 | - } |
|
| 770 | - /** |
|
| 771 | - * Lists views (profiles) to which the user has access. (profiles.list) |
|
| 772 | - * |
|
| 773 | - * @param string $accountId Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. |
|
| 774 | - * @param string $webPropertyId Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. |
|
| 775 | - * @param array $optParams Optional parameters. |
|
| 776 | - * |
|
| 777 | - * @opt_param int max-results The maximum number of views (profiles) to include in this response. |
|
| 778 | - * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 779 | - * @return Google_Profiles |
|
| 780 | - */ |
|
| 781 | - public function listManagementProfiles($accountId, $webPropertyId, $optParams = array()) { |
|
| 782 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 783 | - $params = array_merge($params, $optParams); |
|
| 784 | - $data = $this->__call('list', array($params)); |
|
| 785 | - if ($this->useObjects()) { |
|
| 786 | - return new Google_Profiles($data); |
|
| 787 | - } else { |
|
| 788 | - return $data; |
|
| 789 | - } |
|
| 790 | - } |
|
| 791 | - /** |
|
| 792 | - * Updates an existing view (profile). This method supports patch semantics. |
|
| 793 | - * (profiles.patch) |
|
| 794 | - * |
|
| 795 | - * @param string $accountId Account ID to which the view (profile) belongs |
|
| 796 | - * @param string $webPropertyId Web property ID to which the view (profile) belongs |
|
| 797 | - * @param string $profileId ID of the view (profile) to be updated. |
|
| 798 | - * @param Google_Profile $postBody |
|
| 799 | - * @param array $optParams Optional parameters. |
|
| 800 | - * @return Google_Profile |
|
| 801 | - */ |
|
| 802 | - public function patch($accountId, $webPropertyId, $profileId, Google_Profile $postBody, $optParams = array()) { |
|
| 803 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 804 | - $params = array_merge($params, $optParams); |
|
| 805 | - $data = $this->__call('patch', array($params)); |
|
| 806 | - if ($this->useObjects()) { |
|
| 807 | - return new Google_Profile($data); |
|
| 808 | - } else { |
|
| 809 | - return $data; |
|
| 810 | - } |
|
| 811 | - } |
|
| 812 | - /** |
|
| 813 | - * Updates an existing view (profile). (profiles.update) |
|
| 814 | - * |
|
| 815 | - * @param string $accountId Account ID to which the view (profile) belongs |
|
| 816 | - * @param string $webPropertyId Web property ID to which the view (profile) belongs |
|
| 817 | - * @param string $profileId ID of the view (profile) to be updated. |
|
| 818 | - * @param Google_Profile $postBody |
|
| 819 | - * @param array $optParams Optional parameters. |
|
| 820 | - * @return Google_Profile |
|
| 821 | - */ |
|
| 822 | - public function update($accountId, $webPropertyId, $profileId, Google_Profile $postBody, $optParams = array()) { |
|
| 823 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 824 | - $params = array_merge($params, $optParams); |
|
| 825 | - $data = $this->__call('update', array($params)); |
|
| 826 | - if ($this->useObjects()) { |
|
| 827 | - return new Google_Profile($data); |
|
| 828 | - } else { |
|
| 829 | - return $data; |
|
| 830 | - } |
|
| 831 | - } |
|
| 718 | + /** |
|
| 719 | + * Deletes a view (profile). (profiles.delete) |
|
| 720 | + * |
|
| 721 | + * @param string $accountId Account ID to delete the view (profile) for. |
|
| 722 | + * @param string $webPropertyId Web property ID to delete the view (profile) for. |
|
| 723 | + * @param string $profileId ID of the view (profile) to be deleted. |
|
| 724 | + * @param array $optParams Optional parameters. |
|
| 725 | + */ |
|
| 726 | + public function delete($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 727 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 728 | + $params = array_merge($params, $optParams); |
|
| 729 | + $data = $this->__call('delete', array($params)); |
|
| 730 | + return $data; |
|
| 731 | + } |
|
| 732 | + /** |
|
| 733 | + * Gets a view (profile) to which the user has access. (profiles.get) |
|
| 734 | + * |
|
| 735 | + * @param string $accountId Account ID to retrieve the goal for. |
|
| 736 | + * @param string $webPropertyId Web property ID to retrieve the goal for. |
|
| 737 | + * @param string $profileId View (Profile) ID to retrieve the goal for. |
|
| 738 | + * @param array $optParams Optional parameters. |
|
| 739 | + * @return Google_Profile |
|
| 740 | + */ |
|
| 741 | + public function get($accountId, $webPropertyId, $profileId, $optParams = array()) { |
|
| 742 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId); |
|
| 743 | + $params = array_merge($params, $optParams); |
|
| 744 | + $data = $this->__call('get', array($params)); |
|
| 745 | + if ($this->useObjects()) { |
|
| 746 | + return new Google_Profile($data); |
|
| 747 | + } else { |
|
| 748 | + return $data; |
|
| 749 | + } |
|
| 750 | + } |
|
| 751 | + /** |
|
| 752 | + * Create a new view (profile). (profiles.insert) |
|
| 753 | + * |
|
| 754 | + * @param string $accountId Account ID to create the view (profile) for. |
|
| 755 | + * @param string $webPropertyId Web property ID to create the view (profile) for. |
|
| 756 | + * @param Google_Profile $postBody |
|
| 757 | + * @param array $optParams Optional parameters. |
|
| 758 | + * @return Google_Profile |
|
| 759 | + */ |
|
| 760 | + public function insert($accountId, $webPropertyId, Google_Profile $postBody, $optParams = array()) { |
|
| 761 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 762 | + $params = array_merge($params, $optParams); |
|
| 763 | + $data = $this->__call('insert', array($params)); |
|
| 764 | + if ($this->useObjects()) { |
|
| 765 | + return new Google_Profile($data); |
|
| 766 | + } else { |
|
| 767 | + return $data; |
|
| 768 | + } |
|
| 769 | + } |
|
| 770 | + /** |
|
| 771 | + * Lists views (profiles) to which the user has access. (profiles.list) |
|
| 772 | + * |
|
| 773 | + * @param string $accountId Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. |
|
| 774 | + * @param string $webPropertyId Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. |
|
| 775 | + * @param array $optParams Optional parameters. |
|
| 776 | + * |
|
| 777 | + * @opt_param int max-results The maximum number of views (profiles) to include in this response. |
|
| 778 | + * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 779 | + * @return Google_Profiles |
|
| 780 | + */ |
|
| 781 | + public function listManagementProfiles($accountId, $webPropertyId, $optParams = array()) { |
|
| 782 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 783 | + $params = array_merge($params, $optParams); |
|
| 784 | + $data = $this->__call('list', array($params)); |
|
| 785 | + if ($this->useObjects()) { |
|
| 786 | + return new Google_Profiles($data); |
|
| 787 | + } else { |
|
| 788 | + return $data; |
|
| 789 | + } |
|
| 790 | + } |
|
| 791 | + /** |
|
| 792 | + * Updates an existing view (profile). This method supports patch semantics. |
|
| 793 | + * (profiles.patch) |
|
| 794 | + * |
|
| 795 | + * @param string $accountId Account ID to which the view (profile) belongs |
|
| 796 | + * @param string $webPropertyId Web property ID to which the view (profile) belongs |
|
| 797 | + * @param string $profileId ID of the view (profile) to be updated. |
|
| 798 | + * @param Google_Profile $postBody |
|
| 799 | + * @param array $optParams Optional parameters. |
|
| 800 | + * @return Google_Profile |
|
| 801 | + */ |
|
| 802 | + public function patch($accountId, $webPropertyId, $profileId, Google_Profile $postBody, $optParams = array()) { |
|
| 803 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 804 | + $params = array_merge($params, $optParams); |
|
| 805 | + $data = $this->__call('patch', array($params)); |
|
| 806 | + if ($this->useObjects()) { |
|
| 807 | + return new Google_Profile($data); |
|
| 808 | + } else { |
|
| 809 | + return $data; |
|
| 810 | + } |
|
| 811 | + } |
|
| 812 | + /** |
|
| 813 | + * Updates an existing view (profile). (profiles.update) |
|
| 814 | + * |
|
| 815 | + * @param string $accountId Account ID to which the view (profile) belongs |
|
| 816 | + * @param string $webPropertyId Web property ID to which the view (profile) belongs |
|
| 817 | + * @param string $profileId ID of the view (profile) to be updated. |
|
| 818 | + * @param Google_Profile $postBody |
|
| 819 | + * @param array $optParams Optional parameters. |
|
| 820 | + * @return Google_Profile |
|
| 821 | + */ |
|
| 822 | + public function update($accountId, $webPropertyId, $profileId, Google_Profile $postBody, $optParams = array()) { |
|
| 823 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody); |
|
| 824 | + $params = array_merge($params, $optParams); |
|
| 825 | + $data = $this->__call('update', array($params)); |
|
| 826 | + if ($this->useObjects()) { |
|
| 827 | + return new Google_Profile($data); |
|
| 828 | + } else { |
|
| 829 | + return $data; |
|
| 830 | + } |
|
| 831 | + } |
|
| 832 | 832 | } |
| 833 | 833 | /** |
| 834 | 834 | * The "segments" collection of methods. |
@@ -840,25 +840,25 @@ discard block |
||
| 840 | 840 | */ |
| 841 | 841 | class Google_ManagementSegmentsServiceResource extends Google_ServiceResource { |
| 842 | 842 | |
| 843 | - /** |
|
| 844 | - * Lists advanced segments to which the user has access. (segments.list) |
|
| 845 | - * |
|
| 846 | - * @param array $optParams Optional parameters. |
|
| 847 | - * |
|
| 848 | - * @opt_param int max-results The maximum number of advanced segments to include in this response. |
|
| 849 | - * @opt_param int start-index An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 850 | - * @return Google_Segments |
|
| 851 | - */ |
|
| 852 | - public function listManagementSegments($optParams = array()) { |
|
| 853 | - $params = array(); |
|
| 854 | - $params = array_merge($params, $optParams); |
|
| 855 | - $data = $this->__call('list', array($params)); |
|
| 856 | - if ($this->useObjects()) { |
|
| 857 | - return new Google_Segments($data); |
|
| 858 | - } else { |
|
| 859 | - return $data; |
|
| 860 | - } |
|
| 861 | - } |
|
| 843 | + /** |
|
| 844 | + * Lists advanced segments to which the user has access. (segments.list) |
|
| 845 | + * |
|
| 846 | + * @param array $optParams Optional parameters. |
|
| 847 | + * |
|
| 848 | + * @opt_param int max-results The maximum number of advanced segments to include in this response. |
|
| 849 | + * @opt_param int start-index An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 850 | + * @return Google_Segments |
|
| 851 | + */ |
|
| 852 | + public function listManagementSegments($optParams = array()) { |
|
| 853 | + $params = array(); |
|
| 854 | + $params = array_merge($params, $optParams); |
|
| 855 | + $data = $this->__call('list', array($params)); |
|
| 856 | + if ($this->useObjects()) { |
|
| 857 | + return new Google_Segments($data); |
|
| 858 | + } else { |
|
| 859 | + return $data; |
|
| 860 | + } |
|
| 861 | + } |
|
| 862 | 862 | } |
| 863 | 863 | /** |
| 864 | 864 | * The "uploads" collection of methods. |
@@ -870,82 +870,82 @@ discard block |
||
| 870 | 870 | */ |
| 871 | 871 | class Google_ManagementUploadsServiceResource extends Google_ServiceResource { |
| 872 | 872 | |
| 873 | - /** |
|
| 874 | - * Delete data associated with a previous upload. (uploads.deleteUploadData) |
|
| 875 | - * |
|
| 876 | - * @param string $accountId Account Id for the uploads to be deleted. |
|
| 877 | - * @param string $webPropertyId Web property Id for the uploads to be deleted. |
|
| 878 | - * @param string $customDataSourceId Custom data source Id for the uploads to be deleted. |
|
| 879 | - * @param Google_AnalyticsDataimportDeleteUploadDataRequest $postBody |
|
| 880 | - * @param array $optParams Optional parameters. |
|
| 881 | - */ |
|
| 882 | - public function deleteUploadData($accountId, $webPropertyId, $customDataSourceId, Google_AnalyticsDataimportDeleteUploadDataRequest $postBody, $optParams = array()) { |
|
| 883 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'postBody' => $postBody); |
|
| 884 | - $params = array_merge($params, $optParams); |
|
| 885 | - $data = $this->__call('deleteUploadData', array($params)); |
|
| 886 | - return $data; |
|
| 887 | - } |
|
| 888 | - /** |
|
| 889 | - * List uploads to which the user has access. (uploads.get) |
|
| 890 | - * |
|
| 891 | - * @param string $accountId Account Id for the upload to retrieve. |
|
| 892 | - * @param string $webPropertyId Web property Id for the upload to retrieve. |
|
| 893 | - * @param string $customDataSourceId Custom data source Id for upload to retrieve. |
|
| 894 | - * @param string $uploadId Upload Id to retrieve. |
|
| 895 | - * @param array $optParams Optional parameters. |
|
| 896 | - * @return Google_Upload |
|
| 897 | - */ |
|
| 898 | - public function get($accountId, $webPropertyId, $customDataSourceId, $uploadId, $optParams = array()) { |
|
| 899 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'uploadId' => $uploadId); |
|
| 900 | - $params = array_merge($params, $optParams); |
|
| 901 | - $data = $this->__call('get', array($params)); |
|
| 902 | - if ($this->useObjects()) { |
|
| 903 | - return new Google_Upload($data); |
|
| 904 | - } else { |
|
| 905 | - return $data; |
|
| 906 | - } |
|
| 907 | - } |
|
| 908 | - /** |
|
| 909 | - * List uploads to which the user has access. (uploads.list) |
|
| 910 | - * |
|
| 911 | - * @param string $accountId Account Id for the uploads to retrieve. |
|
| 912 | - * @param string $webPropertyId Web property Id for the uploads to retrieve. |
|
| 913 | - * @param string $customDataSourceId Custom data source Id for uploads to retrieve. |
|
| 914 | - * @param array $optParams Optional parameters. |
|
| 915 | - * |
|
| 916 | - * @opt_param int max-results The maximum number of uploads to include in this response. |
|
| 917 | - * @opt_param int start-index A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 918 | - * @return Google_Uploads |
|
| 919 | - */ |
|
| 920 | - public function listManagementUploads($accountId, $webPropertyId, $customDataSourceId, $optParams = array()) { |
|
| 921 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId); |
|
| 922 | - $params = array_merge($params, $optParams); |
|
| 923 | - $data = $this->__call('list', array($params)); |
|
| 924 | - if ($this->useObjects()) { |
|
| 925 | - return new Google_Uploads($data); |
|
| 926 | - } else { |
|
| 927 | - return $data; |
|
| 928 | - } |
|
| 929 | - } |
|
| 930 | - /** |
|
| 931 | - * Upload/Overwrite data for a custom data source. (uploads.uploadData) |
|
| 932 | - * |
|
| 933 | - * @param string $accountId Account Id associated with the upload. |
|
| 934 | - * @param string $webPropertyId Web property UA-string associated with the upload. |
|
| 935 | - * @param string $customDataSourceId Custom data source Id to which the data being uploaded belongs. |
|
| 936 | - * @param array $optParams Optional parameters. |
|
| 937 | - * @return Google_Upload |
|
| 938 | - */ |
|
| 939 | - public function uploadData($accountId, $webPropertyId, $customDataSourceId, $optParams = array()) { |
|
| 940 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId); |
|
| 941 | - $params = array_merge($params, $optParams); |
|
| 942 | - $data = $this->__call('uploadData', array($params)); |
|
| 943 | - if ($this->useObjects()) { |
|
| 944 | - return new Google_Upload($data); |
|
| 945 | - } else { |
|
| 946 | - return $data; |
|
| 947 | - } |
|
| 948 | - } |
|
| 873 | + /** |
|
| 874 | + * Delete data associated with a previous upload. (uploads.deleteUploadData) |
|
| 875 | + * |
|
| 876 | + * @param string $accountId Account Id for the uploads to be deleted. |
|
| 877 | + * @param string $webPropertyId Web property Id for the uploads to be deleted. |
|
| 878 | + * @param string $customDataSourceId Custom data source Id for the uploads to be deleted. |
|
| 879 | + * @param Google_AnalyticsDataimportDeleteUploadDataRequest $postBody |
|
| 880 | + * @param array $optParams Optional parameters. |
|
| 881 | + */ |
|
| 882 | + public function deleteUploadData($accountId, $webPropertyId, $customDataSourceId, Google_AnalyticsDataimportDeleteUploadDataRequest $postBody, $optParams = array()) { |
|
| 883 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'postBody' => $postBody); |
|
| 884 | + $params = array_merge($params, $optParams); |
|
| 885 | + $data = $this->__call('deleteUploadData', array($params)); |
|
| 886 | + return $data; |
|
| 887 | + } |
|
| 888 | + /** |
|
| 889 | + * List uploads to which the user has access. (uploads.get) |
|
| 890 | + * |
|
| 891 | + * @param string $accountId Account Id for the upload to retrieve. |
|
| 892 | + * @param string $webPropertyId Web property Id for the upload to retrieve. |
|
| 893 | + * @param string $customDataSourceId Custom data source Id for upload to retrieve. |
|
| 894 | + * @param string $uploadId Upload Id to retrieve. |
|
| 895 | + * @param array $optParams Optional parameters. |
|
| 896 | + * @return Google_Upload |
|
| 897 | + */ |
|
| 898 | + public function get($accountId, $webPropertyId, $customDataSourceId, $uploadId, $optParams = array()) { |
|
| 899 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'uploadId' => $uploadId); |
|
| 900 | + $params = array_merge($params, $optParams); |
|
| 901 | + $data = $this->__call('get', array($params)); |
|
| 902 | + if ($this->useObjects()) { |
|
| 903 | + return new Google_Upload($data); |
|
| 904 | + } else { |
|
| 905 | + return $data; |
|
| 906 | + } |
|
| 907 | + } |
|
| 908 | + /** |
|
| 909 | + * List uploads to which the user has access. (uploads.list) |
|
| 910 | + * |
|
| 911 | + * @param string $accountId Account Id for the uploads to retrieve. |
|
| 912 | + * @param string $webPropertyId Web property Id for the uploads to retrieve. |
|
| 913 | + * @param string $customDataSourceId Custom data source Id for uploads to retrieve. |
|
| 914 | + * @param array $optParams Optional parameters. |
|
| 915 | + * |
|
| 916 | + * @opt_param int max-results The maximum number of uploads to include in this response. |
|
| 917 | + * @opt_param int start-index A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 918 | + * @return Google_Uploads |
|
| 919 | + */ |
|
| 920 | + public function listManagementUploads($accountId, $webPropertyId, $customDataSourceId, $optParams = array()) { |
|
| 921 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId); |
|
| 922 | + $params = array_merge($params, $optParams); |
|
| 923 | + $data = $this->__call('list', array($params)); |
|
| 924 | + if ($this->useObjects()) { |
|
| 925 | + return new Google_Uploads($data); |
|
| 926 | + } else { |
|
| 927 | + return $data; |
|
| 928 | + } |
|
| 929 | + } |
|
| 930 | + /** |
|
| 931 | + * Upload/Overwrite data for a custom data source. (uploads.uploadData) |
|
| 932 | + * |
|
| 933 | + * @param string $accountId Account Id associated with the upload. |
|
| 934 | + * @param string $webPropertyId Web property UA-string associated with the upload. |
|
| 935 | + * @param string $customDataSourceId Custom data source Id to which the data being uploaded belongs. |
|
| 936 | + * @param array $optParams Optional parameters. |
|
| 937 | + * @return Google_Upload |
|
| 938 | + */ |
|
| 939 | + public function uploadData($accountId, $webPropertyId, $customDataSourceId, $optParams = array()) { |
|
| 940 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId); |
|
| 941 | + $params = array_merge($params, $optParams); |
|
| 942 | + $data = $this->__call('uploadData', array($params)); |
|
| 943 | + if ($this->useObjects()) { |
|
| 944 | + return new Google_Upload($data); |
|
| 945 | + } else { |
|
| 946 | + return $data; |
|
| 947 | + } |
|
| 948 | + } |
|
| 949 | 949 | } |
| 950 | 950 | /** |
| 951 | 951 | * The "webproperties" collection of methods. |
@@ -957,102 +957,102 @@ discard block |
||
| 957 | 957 | */ |
| 958 | 958 | class Google_ManagementWebpropertiesServiceResource extends Google_ServiceResource { |
| 959 | 959 | |
| 960 | - /** |
|
| 961 | - * Gets a web property to which the user has access. (webproperties.get) |
|
| 962 | - * |
|
| 963 | - * @param string $accountId Account ID to retrieve the web property for. |
|
| 964 | - * @param string $webPropertyId ID to retrieve the web property for. |
|
| 965 | - * @param array $optParams Optional parameters. |
|
| 966 | - * @return Google_Webproperty |
|
| 967 | - */ |
|
| 968 | - public function get($accountId, $webPropertyId, $optParams = array()) { |
|
| 969 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 970 | - $params = array_merge($params, $optParams); |
|
| 971 | - $data = $this->__call('get', array($params)); |
|
| 972 | - if ($this->useObjects()) { |
|
| 973 | - return new Google_Webproperty($data); |
|
| 974 | - } else { |
|
| 975 | - return $data; |
|
| 976 | - } |
|
| 977 | - } |
|
| 978 | - /** |
|
| 979 | - * Create a new property if the account has fewer than 20 properties. |
|
| 980 | - * (webproperties.insert) |
|
| 981 | - * |
|
| 982 | - * @param string $accountId Account ID to create the web property for. |
|
| 983 | - * @param Google_Webproperty $postBody |
|
| 984 | - * @param array $optParams Optional parameters. |
|
| 985 | - * @return Google_Webproperty |
|
| 986 | - */ |
|
| 987 | - public function insert($accountId, Google_Webproperty $postBody, $optParams = array()) { |
|
| 988 | - $params = array('accountId' => $accountId, 'postBody' => $postBody); |
|
| 989 | - $params = array_merge($params, $optParams); |
|
| 990 | - $data = $this->__call('insert', array($params)); |
|
| 991 | - if ($this->useObjects()) { |
|
| 992 | - return new Google_Webproperty($data); |
|
| 993 | - } else { |
|
| 994 | - return $data; |
|
| 995 | - } |
|
| 996 | - } |
|
| 997 | - /** |
|
| 998 | - * Lists web properties to which the user has access. (webproperties.list) |
|
| 999 | - * |
|
| 1000 | - * @param string $accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. |
|
| 1001 | - * @param array $optParams Optional parameters. |
|
| 1002 | - * |
|
| 1003 | - * @opt_param int max-results The maximum number of web properties to include in this response. |
|
| 1004 | - * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 1005 | - * @return Google_Webproperties |
|
| 1006 | - */ |
|
| 1007 | - public function listManagementWebproperties($accountId, $optParams = array()) { |
|
| 1008 | - $params = array('accountId' => $accountId); |
|
| 1009 | - $params = array_merge($params, $optParams); |
|
| 1010 | - $data = $this->__call('list', array($params)); |
|
| 1011 | - if ($this->useObjects()) { |
|
| 1012 | - return new Google_Webproperties($data); |
|
| 1013 | - } else { |
|
| 1014 | - return $data; |
|
| 1015 | - } |
|
| 1016 | - } |
|
| 1017 | - /** |
|
| 1018 | - * Updates an existing web property. This method supports patch semantics. |
|
| 1019 | - * (webproperties.patch) |
|
| 1020 | - * |
|
| 1021 | - * @param string $accountId Account ID to which the web property belongs |
|
| 1022 | - * @param string $webPropertyId Web property ID |
|
| 1023 | - * @param Google_Webproperty $postBody |
|
| 1024 | - * @param array $optParams Optional parameters. |
|
| 1025 | - * @return Google_Webproperty |
|
| 1026 | - */ |
|
| 1027 | - public function patch($accountId, $webPropertyId, Google_Webproperty $postBody, $optParams = array()) { |
|
| 1028 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 1029 | - $params = array_merge($params, $optParams); |
|
| 1030 | - $data = $this->__call('patch', array($params)); |
|
| 1031 | - if ($this->useObjects()) { |
|
| 1032 | - return new Google_Webproperty($data); |
|
| 1033 | - } else { |
|
| 1034 | - return $data; |
|
| 1035 | - } |
|
| 1036 | - } |
|
| 1037 | - /** |
|
| 1038 | - * Updates an existing web property. (webproperties.update) |
|
| 1039 | - * |
|
| 1040 | - * @param string $accountId Account ID to which the web property belongs |
|
| 1041 | - * @param string $webPropertyId Web property ID |
|
| 1042 | - * @param Google_Webproperty $postBody |
|
| 1043 | - * @param array $optParams Optional parameters. |
|
| 1044 | - * @return Google_Webproperty |
|
| 1045 | - */ |
|
| 1046 | - public function update($accountId, $webPropertyId, Google_Webproperty $postBody, $optParams = array()) { |
|
| 1047 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 1048 | - $params = array_merge($params, $optParams); |
|
| 1049 | - $data = $this->__call('update', array($params)); |
|
| 1050 | - if ($this->useObjects()) { |
|
| 1051 | - return new Google_Webproperty($data); |
|
| 1052 | - } else { |
|
| 1053 | - return $data; |
|
| 1054 | - } |
|
| 1055 | - } |
|
| 960 | + /** |
|
| 961 | + * Gets a web property to which the user has access. (webproperties.get) |
|
| 962 | + * |
|
| 963 | + * @param string $accountId Account ID to retrieve the web property for. |
|
| 964 | + * @param string $webPropertyId ID to retrieve the web property for. |
|
| 965 | + * @param array $optParams Optional parameters. |
|
| 966 | + * @return Google_Webproperty |
|
| 967 | + */ |
|
| 968 | + public function get($accountId, $webPropertyId, $optParams = array()) { |
|
| 969 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 970 | + $params = array_merge($params, $optParams); |
|
| 971 | + $data = $this->__call('get', array($params)); |
|
| 972 | + if ($this->useObjects()) { |
|
| 973 | + return new Google_Webproperty($data); |
|
| 974 | + } else { |
|
| 975 | + return $data; |
|
| 976 | + } |
|
| 977 | + } |
|
| 978 | + /** |
|
| 979 | + * Create a new property if the account has fewer than 20 properties. |
|
| 980 | + * (webproperties.insert) |
|
| 981 | + * |
|
| 982 | + * @param string $accountId Account ID to create the web property for. |
|
| 983 | + * @param Google_Webproperty $postBody |
|
| 984 | + * @param array $optParams Optional parameters. |
|
| 985 | + * @return Google_Webproperty |
|
| 986 | + */ |
|
| 987 | + public function insert($accountId, Google_Webproperty $postBody, $optParams = array()) { |
|
| 988 | + $params = array('accountId' => $accountId, 'postBody' => $postBody); |
|
| 989 | + $params = array_merge($params, $optParams); |
|
| 990 | + $data = $this->__call('insert', array($params)); |
|
| 991 | + if ($this->useObjects()) { |
|
| 992 | + return new Google_Webproperty($data); |
|
| 993 | + } else { |
|
| 994 | + return $data; |
|
| 995 | + } |
|
| 996 | + } |
|
| 997 | + /** |
|
| 998 | + * Lists web properties to which the user has access. (webproperties.list) |
|
| 999 | + * |
|
| 1000 | + * @param string $accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. |
|
| 1001 | + * @param array $optParams Optional parameters. |
|
| 1002 | + * |
|
| 1003 | + * @opt_param int max-results The maximum number of web properties to include in this response. |
|
| 1004 | + * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 1005 | + * @return Google_Webproperties |
|
| 1006 | + */ |
|
| 1007 | + public function listManagementWebproperties($accountId, $optParams = array()) { |
|
| 1008 | + $params = array('accountId' => $accountId); |
|
| 1009 | + $params = array_merge($params, $optParams); |
|
| 1010 | + $data = $this->__call('list', array($params)); |
|
| 1011 | + if ($this->useObjects()) { |
|
| 1012 | + return new Google_Webproperties($data); |
|
| 1013 | + } else { |
|
| 1014 | + return $data; |
|
| 1015 | + } |
|
| 1016 | + } |
|
| 1017 | + /** |
|
| 1018 | + * Updates an existing web property. This method supports patch semantics. |
|
| 1019 | + * (webproperties.patch) |
|
| 1020 | + * |
|
| 1021 | + * @param string $accountId Account ID to which the web property belongs |
|
| 1022 | + * @param string $webPropertyId Web property ID |
|
| 1023 | + * @param Google_Webproperty $postBody |
|
| 1024 | + * @param array $optParams Optional parameters. |
|
| 1025 | + * @return Google_Webproperty |
|
| 1026 | + */ |
|
| 1027 | + public function patch($accountId, $webPropertyId, Google_Webproperty $postBody, $optParams = array()) { |
|
| 1028 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 1029 | + $params = array_merge($params, $optParams); |
|
| 1030 | + $data = $this->__call('patch', array($params)); |
|
| 1031 | + if ($this->useObjects()) { |
|
| 1032 | + return new Google_Webproperty($data); |
|
| 1033 | + } else { |
|
| 1034 | + return $data; |
|
| 1035 | + } |
|
| 1036 | + } |
|
| 1037 | + /** |
|
| 1038 | + * Updates an existing web property. (webproperties.update) |
|
| 1039 | + * |
|
| 1040 | + * @param string $accountId Account ID to which the web property belongs |
|
| 1041 | + * @param string $webPropertyId Web property ID |
|
| 1042 | + * @param Google_Webproperty $postBody |
|
| 1043 | + * @param array $optParams Optional parameters. |
|
| 1044 | + * @return Google_Webproperty |
|
| 1045 | + */ |
|
| 1046 | + public function update($accountId, $webPropertyId, Google_Webproperty $postBody, $optParams = array()) { |
|
| 1047 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 1048 | + $params = array_merge($params, $optParams); |
|
| 1049 | + $data = $this->__call('update', array($params)); |
|
| 1050 | + if ($this->useObjects()) { |
|
| 1051 | + return new Google_Webproperty($data); |
|
| 1052 | + } else { |
|
| 1053 | + return $data; |
|
| 1054 | + } |
|
| 1055 | + } |
|
| 1056 | 1056 | } |
| 1057 | 1057 | /** |
| 1058 | 1058 | * The "webpropertyUserLinks" collection of methods. |
@@ -1064,82 +1064,82 @@ discard block |
||
| 1064 | 1064 | */ |
| 1065 | 1065 | class Google_ManagementWebpropertyUserLinksServiceResource extends Google_ServiceResource { |
| 1066 | 1066 | |
| 1067 | - /** |
|
| 1068 | - * Removes a user from the given web property. (webpropertyUserLinks.delete) |
|
| 1069 | - * |
|
| 1070 | - * @param string $accountId Account ID to delete the user link for. |
|
| 1071 | - * @param string $webPropertyId Web Property ID to delete the user link for. |
|
| 1072 | - * @param string $linkId Link ID to delete the user link for. |
|
| 1073 | - * @param array $optParams Optional parameters. |
|
| 1074 | - */ |
|
| 1075 | - public function delete($accountId, $webPropertyId, $linkId, $optParams = array()) { |
|
| 1076 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId); |
|
| 1077 | - $params = array_merge($params, $optParams); |
|
| 1078 | - $data = $this->__call('delete', array($params)); |
|
| 1079 | - return $data; |
|
| 1080 | - } |
|
| 1081 | - /** |
|
| 1082 | - * Adds a new user to the given web property. (webpropertyUserLinks.insert) |
|
| 1083 | - * |
|
| 1084 | - * @param string $accountId Account ID to create the user link for. |
|
| 1085 | - * @param string $webPropertyId Web Property ID to create the user link for. |
|
| 1086 | - * @param Google_EntityUserLink $postBody |
|
| 1087 | - * @param array $optParams Optional parameters. |
|
| 1088 | - * @return Google_EntityUserLink |
|
| 1089 | - */ |
|
| 1090 | - public function insert($accountId, $webPropertyId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 1091 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 1092 | - $params = array_merge($params, $optParams); |
|
| 1093 | - $data = $this->__call('insert', array($params)); |
|
| 1094 | - if ($this->useObjects()) { |
|
| 1095 | - return new Google_EntityUserLink($data); |
|
| 1096 | - } else { |
|
| 1097 | - return $data; |
|
| 1098 | - } |
|
| 1099 | - } |
|
| 1100 | - /** |
|
| 1101 | - * Lists webProperty-user links for a given web property. |
|
| 1102 | - * (webpropertyUserLinks.list) |
|
| 1103 | - * |
|
| 1104 | - * @param string $accountId Account ID which the given web property belongs to. |
|
| 1105 | - * @param string $webPropertyId Web Property ID for the webProperty-user links to retrieve. |
|
| 1106 | - * @param array $optParams Optional parameters. |
|
| 1107 | - * |
|
| 1108 | - * @opt_param int max-results The maximum number of webProperty-user Links to include in this response. |
|
| 1109 | - * @opt_param int start-index An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 1110 | - * @return Google_EntityUserLinks |
|
| 1111 | - */ |
|
| 1112 | - public function listManagementWebpropertyUserLinks($accountId, $webPropertyId, $optParams = array()) { |
|
| 1113 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 1114 | - $params = array_merge($params, $optParams); |
|
| 1115 | - $data = $this->__call('list', array($params)); |
|
| 1116 | - if ($this->useObjects()) { |
|
| 1117 | - return new Google_EntityUserLinks($data); |
|
| 1118 | - } else { |
|
| 1119 | - return $data; |
|
| 1120 | - } |
|
| 1121 | - } |
|
| 1122 | - /** |
|
| 1123 | - * Updates permissions for an existing user on the given web property. |
|
| 1124 | - * (webpropertyUserLinks.update) |
|
| 1125 | - * |
|
| 1126 | - * @param string $accountId Account ID to update the account-user link for. |
|
| 1127 | - * @param string $webPropertyId Web property ID to update the account-user link for. |
|
| 1128 | - * @param string $linkId Link ID to update the account-user link for. |
|
| 1129 | - * @param Google_EntityUserLink $postBody |
|
| 1130 | - * @param array $optParams Optional parameters. |
|
| 1131 | - * @return Google_EntityUserLink |
|
| 1132 | - */ |
|
| 1133 | - public function update($accountId, $webPropertyId, $linkId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 1134 | - $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId, 'postBody' => $postBody); |
|
| 1135 | - $params = array_merge($params, $optParams); |
|
| 1136 | - $data = $this->__call('update', array($params)); |
|
| 1137 | - if ($this->useObjects()) { |
|
| 1138 | - return new Google_EntityUserLink($data); |
|
| 1139 | - } else { |
|
| 1140 | - return $data; |
|
| 1141 | - } |
|
| 1142 | - } |
|
| 1067 | + /** |
|
| 1068 | + * Removes a user from the given web property. (webpropertyUserLinks.delete) |
|
| 1069 | + * |
|
| 1070 | + * @param string $accountId Account ID to delete the user link for. |
|
| 1071 | + * @param string $webPropertyId Web Property ID to delete the user link for. |
|
| 1072 | + * @param string $linkId Link ID to delete the user link for. |
|
| 1073 | + * @param array $optParams Optional parameters. |
|
| 1074 | + */ |
|
| 1075 | + public function delete($accountId, $webPropertyId, $linkId, $optParams = array()) { |
|
| 1076 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId); |
|
| 1077 | + $params = array_merge($params, $optParams); |
|
| 1078 | + $data = $this->__call('delete', array($params)); |
|
| 1079 | + return $data; |
|
| 1080 | + } |
|
| 1081 | + /** |
|
| 1082 | + * Adds a new user to the given web property. (webpropertyUserLinks.insert) |
|
| 1083 | + * |
|
| 1084 | + * @param string $accountId Account ID to create the user link for. |
|
| 1085 | + * @param string $webPropertyId Web Property ID to create the user link for. |
|
| 1086 | + * @param Google_EntityUserLink $postBody |
|
| 1087 | + * @param array $optParams Optional parameters. |
|
| 1088 | + * @return Google_EntityUserLink |
|
| 1089 | + */ |
|
| 1090 | + public function insert($accountId, $webPropertyId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 1091 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody); |
|
| 1092 | + $params = array_merge($params, $optParams); |
|
| 1093 | + $data = $this->__call('insert', array($params)); |
|
| 1094 | + if ($this->useObjects()) { |
|
| 1095 | + return new Google_EntityUserLink($data); |
|
| 1096 | + } else { |
|
| 1097 | + return $data; |
|
| 1098 | + } |
|
| 1099 | + } |
|
| 1100 | + /** |
|
| 1101 | + * Lists webProperty-user links for a given web property. |
|
| 1102 | + * (webpropertyUserLinks.list) |
|
| 1103 | + * |
|
| 1104 | + * @param string $accountId Account ID which the given web property belongs to. |
|
| 1105 | + * @param string $webPropertyId Web Property ID for the webProperty-user links to retrieve. |
|
| 1106 | + * @param array $optParams Optional parameters. |
|
| 1107 | + * |
|
| 1108 | + * @opt_param int max-results The maximum number of webProperty-user Links to include in this response. |
|
| 1109 | + * @opt_param int start-index An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
|
| 1110 | + * @return Google_EntityUserLinks |
|
| 1111 | + */ |
|
| 1112 | + public function listManagementWebpropertyUserLinks($accountId, $webPropertyId, $optParams = array()) { |
|
| 1113 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId); |
|
| 1114 | + $params = array_merge($params, $optParams); |
|
| 1115 | + $data = $this->__call('list', array($params)); |
|
| 1116 | + if ($this->useObjects()) { |
|
| 1117 | + return new Google_EntityUserLinks($data); |
|
| 1118 | + } else { |
|
| 1119 | + return $data; |
|
| 1120 | + } |
|
| 1121 | + } |
|
| 1122 | + /** |
|
| 1123 | + * Updates permissions for an existing user on the given web property. |
|
| 1124 | + * (webpropertyUserLinks.update) |
|
| 1125 | + * |
|
| 1126 | + * @param string $accountId Account ID to update the account-user link for. |
|
| 1127 | + * @param string $webPropertyId Web property ID to update the account-user link for. |
|
| 1128 | + * @param string $linkId Link ID to update the account-user link for. |
|
| 1129 | + * @param Google_EntityUserLink $postBody |
|
| 1130 | + * @param array $optParams Optional parameters. |
|
| 1131 | + * @return Google_EntityUserLink |
|
| 1132 | + */ |
|
| 1133 | + public function update($accountId, $webPropertyId, $linkId, Google_EntityUserLink $postBody, $optParams = array()) { |
|
| 1134 | + $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId, 'postBody' => $postBody); |
|
| 1135 | + $params = array_merge($params, $optParams); |
|
| 1136 | + $data = $this->__call('update', array($params)); |
|
| 1137 | + if ($this->useObjects()) { |
|
| 1138 | + return new Google_EntityUserLink($data); |
|
| 1139 | + } else { |
|
| 1140 | + return $data; |
|
| 1141 | + } |
|
| 1142 | + } |
|
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | /** |
@@ -1164,23 +1164,23 @@ discard block |
||
| 1164 | 1164 | */ |
| 1165 | 1165 | class Google_MetadataColumnsServiceResource extends Google_ServiceResource { |
| 1166 | 1166 | |
| 1167 | - /** |
|
| 1168 | - * Lists all columns for a report type (columns.list) |
|
| 1169 | - * |
|
| 1170 | - * @param string $reportType Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API |
|
| 1171 | - * @param array $optParams Optional parameters. |
|
| 1172 | - * @return Google_Columns |
|
| 1173 | - */ |
|
| 1174 | - public function listMetadataColumns($reportType, $optParams = array()) { |
|
| 1175 | - $params = array('reportType' => $reportType); |
|
| 1176 | - $params = array_merge($params, $optParams); |
|
| 1177 | - $data = $this->__call('list', array($params)); |
|
| 1178 | - if ($this->useObjects()) { |
|
| 1179 | - return new Google_Columns($data); |
|
| 1180 | - } else { |
|
| 1181 | - return $data; |
|
| 1182 | - } |
|
| 1183 | - } |
|
| 1167 | + /** |
|
| 1168 | + * Lists all columns for a report type (columns.list) |
|
| 1169 | + * |
|
| 1170 | + * @param string $reportType Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API |
|
| 1171 | + * @param array $optParams Optional parameters. |
|
| 1172 | + * @return Google_Columns |
|
| 1173 | + */ |
|
| 1174 | + public function listMetadataColumns($reportType, $optParams = array()) { |
|
| 1175 | + $params = array('reportType' => $reportType); |
|
| 1176 | + $params = array_merge($params, $optParams); |
|
| 1177 | + $data = $this->__call('list', array($params)); |
|
| 1178 | + if ($this->useObjects()) { |
|
| 1179 | + return new Google_Columns($data); |
|
| 1180 | + } else { |
|
| 1181 | + return $data; |
|
| 1182 | + } |
|
| 1183 | + } |
|
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | /** |
@@ -1220,27 +1220,27 @@ discard block |
||
| 1220 | 1220 | * @param Google_Client $client |
| 1221 | 1221 | */ |
| 1222 | 1222 | public function __construct(Google_Client $client) { |
| 1223 | - $this->servicePath = 'analytics/v3/'; |
|
| 1224 | - $this->version = 'v3'; |
|
| 1225 | - $this->serviceName = 'analytics'; |
|
| 1223 | + $this->servicePath = 'analytics/v3/'; |
|
| 1224 | + $this->version = 'v3'; |
|
| 1225 | + $this->serviceName = 'analytics'; |
|
| 1226 | 1226 | |
| 1227 | - $client->addService($this->serviceName, $this->version); |
|
| 1228 | - $this->data_ga = new Google_DataGaServiceResource($this, $this->serviceName, 'ga', json_decode('{"methods": {"get": {"id": "analytics.data.ga.get", "path": "data/ga", "httpMethod": "GET", "parameters": {"dimensions": {"type": "string", "location": "query"}, "end-date": {"type": "string", "required": true, "location": "query"}, "filters": {"type": "string", "location": "query"}, "ids": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "metrics": {"type": "string", "required": true, "location": "query"}, "segment": {"type": "string", "location": "query"}, "sort": {"type": "string", "location": "query"}, "start-date": {"type": "string", "required": true, "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "GaData"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1229 | - $this->data_mcf = new Google_DataMcfServiceResource($this, $this->serviceName, 'mcf', json_decode('{"methods": {"get": {"id": "analytics.data.mcf.get", "path": "data/mcf", "httpMethod": "GET", "parameters": {"dimensions": {"type": "string", "location": "query"}, "end-date": {"type": "string", "required": true, "location": "query"}, "filters": {"type": "string", "location": "query"}, "ids": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "metrics": {"type": "string", "required": true, "location": "query"}, "sort": {"type": "string", "location": "query"}, "start-date": {"type": "string", "required": true, "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "McfData"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1230 | - $this->data_realtime = new Google_DataRealtimeServiceResource($this, $this->serviceName, 'realtime', json_decode('{"methods": {"get": {"id": "analytics.data.realtime.get", "path": "data/realtime", "httpMethod": "GET", "parameters": {"dimensions": {"type": "string", "location": "query"}, "filters": {"type": "string", "location": "query"}, "ids": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "metrics": {"type": "string", "required": true, "location": "query"}, "sort": {"type": "string", "location": "query"}}, "response": {"$ref": "RealtimeData"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1231 | - $this->management_accountUserLinks = new Google_ManagementAccountUserLinksServiceResource($this, $this->serviceName, 'accountUserLinks', json_decode('{"methods": {"delete": {"id": "analytics.management.accountUserLinks.delete", "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "insert": {"id": "analytics.management.accountUserLinks.insert", "path": "management/accounts/{accountId}/entityUserLinks", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "list": {"id": "analytics.management.accountUserLinks.list", "path": "management/accounts/{accountId}/entityUserLinks", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "EntityUserLinks"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "update": {"id": "analytics.management.accountUserLinks.update", "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}}}', true)); |
|
| 1232 | - $this->management_accounts = new Google_ManagementAccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"list": {"id": "analytics.management.accounts.list", "path": "management/accounts", "httpMethod": "GET", "parameters": {"max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "Accounts"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1233 | - $this->management_customDataSources = new Google_ManagementCustomDataSourcesServiceResource($this, $this->serviceName, 'customDataSources', json_decode('{"methods": {"list": {"id": "analytics.management.customDataSources.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "CustomDataSources"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1234 | - $this->management_dailyUploads = new Google_ManagementDailyUploadsServiceResource($this, $this->serviceName, 'dailyUploads', json_decode('{"methods": {"delete": {"id": "analytics.management.dailyUploads.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "date": {"type": "string", "required": true, "location": "path"}, "type": {"type": "string", "required": true, "enum": ["cost"], "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.dailyUploads.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "end-date": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "start-date": {"type": "string", "required": true, "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "DailyUploads"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "upload": {"id": "analytics.management.dailyUploads.upload", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "appendNumber": {"type": "integer", "required": true, "format": "int32", "minimum": "1", "maximum": "20", "location": "query"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "date": {"type": "string", "required": true, "location": "path"}, "reset": {"type": "boolean", "default": "false", "location": "query"}, "type": {"type": "string", "required": true, "enum": ["cost"], "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "DailyUploadAppend"}, "scopes": ["https://www.googleapis.com/auth/analytics"], "supportsMediaUpload": true, "mediaUpload": {"accept": ["application/octet-stream"], "maxSize": "5MB", "protocols": {"simple": {"multipart": true, "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads"}, "resumable": {"multipart": true, "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads"}}}}}}', true)); |
|
| 1235 | - $this->management_experiments = new Google_ManagementExperimentsServiceResource($this, $this->serviceName, 'experiments', json_decode('{"methods": {"delete": {"id": "analytics.management.experiments.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "get": {"id": "analytics.management.experiments.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.experiments.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Experiment"}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.experiments.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "profileId": {"type": "string", "required": true, "location": "path"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Experiments"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.experiments.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Experiment"}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.experiments.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Experiment"}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1236 | - $this->management_goals = new Google_ManagementGoalsServiceResource($this, $this->serviceName, 'goals', json_decode('{"methods": {"get": {"id": "analytics.management.goals.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "goalId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.goals.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Goal"}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.goals.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "profileId": {"type": "string", "required": true, "location": "path"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Goals"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.goals.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "goalId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Goal"}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.goals.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "goalId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Goal"}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1237 | - $this->management_profileUserLinks = new Google_ManagementProfileUserLinksServiceResource($this, $this->serviceName, 'profileUserLinks', json_decode('{"methods": {"delete": {"id": "analytics.management.profileUserLinks.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "insert": {"id": "analytics.management.profileUserLinks.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "list": {"id": "analytics.management.profileUserLinks.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "profileId": {"type": "string", "required": true, "location": "path"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "EntityUserLinks"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "update": {"id": "analytics.management.profileUserLinks.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}}}', true)); |
|
| 1238 | - $this->management_profiles = new Google_ManagementProfilesServiceResource($this, $this->serviceName, 'profiles', json_decode('{"methods": {"delete": {"id": "analytics.management.profiles.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "get": {"id": "analytics.management.profiles.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.profiles.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.profiles.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Profiles"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.profiles.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.profiles.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1239 | - $this->management_segments = new Google_ManagementSegmentsServiceResource($this, $this->serviceName, 'segments', json_decode('{"methods": {"list": {"id": "analytics.management.segments.list", "path": "management/segments", "httpMethod": "GET", "parameters": {"max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "Segments"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1240 | - $this->management_uploads = new Google_ManagementUploadsServiceResource($this, $this->serviceName, 'uploads', json_decode('{"methods": {"deleteUploadData": {"id": "analytics.management.uploads.deleteUploadData", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "AnalyticsDataimportDeleteUploadDataRequest"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "get": {"id": "analytics.management.uploads.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "uploadId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Upload"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "list": {"id": "analytics.management.uploads.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Uploads"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "uploadData": {"id": "analytics.management.uploads.uploadData", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Upload"}, "scopes": ["https://www.googleapis.com/auth/analytics"], "supportsMediaUpload": true, "mediaUpload": {"accept": ["application/octet-stream"], "maxSize": "1GB", "protocols": {"simple": {"multipart": true, "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"}, "resumable": {"multipart": true, "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"}}}}}}', true)); |
|
| 1241 | - $this->management_webproperties = new Google_ManagementWebpropertiesServiceResource($this, $this->serviceName, 'webproperties', json_decode('{"methods": {"get": {"id": "analytics.management.webproperties.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.webproperties.insert", "path": "management/accounts/{accountId}/webproperties", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Webproperty"}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.webproperties.list", "path": "management/accounts/{accountId}/webproperties", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "Webproperties"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.webproperties.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Webproperty"}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.webproperties.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Webproperty"}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1242 | - $this->management_webpropertyUserLinks = new Google_ManagementWebpropertyUserLinksServiceResource($this, $this->serviceName, 'webpropertyUserLinks', json_decode('{"methods": {"delete": {"id": "analytics.management.webpropertyUserLinks.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "insert": {"id": "analytics.management.webpropertyUserLinks.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "list": {"id": "analytics.management.webpropertyUserLinks.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "EntityUserLinks"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "update": {"id": "analytics.management.webpropertyUserLinks.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}}}', true)); |
|
| 1243 | - $this->metadata_columns = new Google_MetadataColumnsServiceResource($this, $this->serviceName, 'columns', json_decode('{"methods": {"list": {"id": "analytics.metadata.columns.list", "path": "metadata/{reportType}/columns", "httpMethod": "GET", "parameters": {"reportType": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Columns"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1227 | + $client->addService($this->serviceName, $this->version); |
|
| 1228 | + $this->data_ga = new Google_DataGaServiceResource($this, $this->serviceName, 'ga', json_decode('{"methods": {"get": {"id": "analytics.data.ga.get", "path": "data/ga", "httpMethod": "GET", "parameters": {"dimensions": {"type": "string", "location": "query"}, "end-date": {"type": "string", "required": true, "location": "query"}, "filters": {"type": "string", "location": "query"}, "ids": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "metrics": {"type": "string", "required": true, "location": "query"}, "segment": {"type": "string", "location": "query"}, "sort": {"type": "string", "location": "query"}, "start-date": {"type": "string", "required": true, "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "GaData"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1229 | + $this->data_mcf = new Google_DataMcfServiceResource($this, $this->serviceName, 'mcf', json_decode('{"methods": {"get": {"id": "analytics.data.mcf.get", "path": "data/mcf", "httpMethod": "GET", "parameters": {"dimensions": {"type": "string", "location": "query"}, "end-date": {"type": "string", "required": true, "location": "query"}, "filters": {"type": "string", "location": "query"}, "ids": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "metrics": {"type": "string", "required": true, "location": "query"}, "sort": {"type": "string", "location": "query"}, "start-date": {"type": "string", "required": true, "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "McfData"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1230 | + $this->data_realtime = new Google_DataRealtimeServiceResource($this, $this->serviceName, 'realtime', json_decode('{"methods": {"get": {"id": "analytics.data.realtime.get", "path": "data/realtime", "httpMethod": "GET", "parameters": {"dimensions": {"type": "string", "location": "query"}, "filters": {"type": "string", "location": "query"}, "ids": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "metrics": {"type": "string", "required": true, "location": "query"}, "sort": {"type": "string", "location": "query"}}, "response": {"$ref": "RealtimeData"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1231 | + $this->management_accountUserLinks = new Google_ManagementAccountUserLinksServiceResource($this, $this->serviceName, 'accountUserLinks', json_decode('{"methods": {"delete": {"id": "analytics.management.accountUserLinks.delete", "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "insert": {"id": "analytics.management.accountUserLinks.insert", "path": "management/accounts/{accountId}/entityUserLinks", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "list": {"id": "analytics.management.accountUserLinks.list", "path": "management/accounts/{accountId}/entityUserLinks", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "EntityUserLinks"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "update": {"id": "analytics.management.accountUserLinks.update", "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}}}', true)); |
|
| 1232 | + $this->management_accounts = new Google_ManagementAccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"list": {"id": "analytics.management.accounts.list", "path": "management/accounts", "httpMethod": "GET", "parameters": {"max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "Accounts"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1233 | + $this->management_customDataSources = new Google_ManagementCustomDataSourcesServiceResource($this, $this->serviceName, 'customDataSources', json_decode('{"methods": {"list": {"id": "analytics.management.customDataSources.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "CustomDataSources"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1234 | + $this->management_dailyUploads = new Google_ManagementDailyUploadsServiceResource($this, $this->serviceName, 'dailyUploads', json_decode('{"methods": {"delete": {"id": "analytics.management.dailyUploads.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "date": {"type": "string", "required": true, "location": "path"}, "type": {"type": "string", "required": true, "enum": ["cost"], "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.dailyUploads.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "end-date": {"type": "string", "required": true, "location": "query"}, "max-results": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "start-date": {"type": "string", "required": true, "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "DailyUploads"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "upload": {"id": "analytics.management.dailyUploads.upload", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "appendNumber": {"type": "integer", "required": true, "format": "int32", "minimum": "1", "maximum": "20", "location": "query"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "date": {"type": "string", "required": true, "location": "path"}, "reset": {"type": "boolean", "default": "false", "location": "query"}, "type": {"type": "string", "required": true, "enum": ["cost"], "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "DailyUploadAppend"}, "scopes": ["https://www.googleapis.com/auth/analytics"], "supportsMediaUpload": true, "mediaUpload": {"accept": ["application/octet-stream"], "maxSize": "5MB", "protocols": {"simple": {"multipart": true, "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads"}, "resumable": {"multipart": true, "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads"}}}}}}', true)); |
|
| 1235 | + $this->management_experiments = new Google_ManagementExperimentsServiceResource($this, $this->serviceName, 'experiments', json_decode('{"methods": {"delete": {"id": "analytics.management.experiments.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "get": {"id": "analytics.management.experiments.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.experiments.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Experiment"}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.experiments.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "profileId": {"type": "string", "required": true, "location": "path"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Experiments"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.experiments.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Experiment"}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.experiments.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "experimentId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Experiment"}, "response": {"$ref": "Experiment"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1236 | + $this->management_goals = new Google_ManagementGoalsServiceResource($this, $this->serviceName, 'goals', json_decode('{"methods": {"get": {"id": "analytics.management.goals.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "goalId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.goals.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Goal"}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.goals.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "profileId": {"type": "string", "required": true, "location": "path"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Goals"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.goals.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "goalId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Goal"}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.goals.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "goalId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Goal"}, "response": {"$ref": "Goal"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1237 | + $this->management_profileUserLinks = new Google_ManagementProfileUserLinksServiceResource($this, $this->serviceName, 'profileUserLinks', json_decode('{"methods": {"delete": {"id": "analytics.management.profileUserLinks.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "insert": {"id": "analytics.management.profileUserLinks.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "list": {"id": "analytics.management.profileUserLinks.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "profileId": {"type": "string", "required": true, "location": "path"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "EntityUserLinks"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "update": {"id": "analytics.management.profileUserLinks.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}}}', true)); |
|
| 1238 | + $this->management_profiles = new Google_ManagementProfilesServiceResource($this, $this->serviceName, 'profiles', json_decode('{"methods": {"delete": {"id": "analytics.management.profiles.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "get": {"id": "analytics.management.profiles.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.profiles.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.profiles.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Profiles"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.profiles.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.profiles.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "profileId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1239 | + $this->management_segments = new Google_ManagementSegmentsServiceResource($this, $this->serviceName, 'segments', json_decode('{"methods": {"list": {"id": "analytics.management.segments.list", "path": "management/segments", "httpMethod": "GET", "parameters": {"max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "Segments"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1240 | + $this->management_uploads = new Google_ManagementUploadsServiceResource($this, $this->serviceName, 'uploads', json_decode('{"methods": {"deleteUploadData": {"id": "analytics.management.uploads.deleteUploadData", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "AnalyticsDataimportDeleteUploadDataRequest"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "get": {"id": "analytics.management.uploads.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "uploadId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Upload"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "list": {"id": "analytics.management.uploads.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Uploads"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "uploadData": {"id": "analytics.management.uploads.uploadData", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "customDataSourceId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Upload"}, "scopes": ["https://www.googleapis.com/auth/analytics"], "supportsMediaUpload": true, "mediaUpload": {"accept": ["application/octet-stream"], "maxSize": "1GB", "protocols": {"simple": {"multipart": true, "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"}, "resumable": {"multipart": true, "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"}}}}}}', true)); |
|
| 1241 | + $this->management_webproperties = new Google_ManagementWebpropertiesServiceResource($this, $this->serviceName, 'webproperties', json_decode('{"methods": {"get": {"id": "analytics.management.webproperties.get", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "insert": {"id": "analytics.management.webproperties.insert", "path": "management/accounts/{accountId}/webproperties", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Webproperty"}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "list": {"id": "analytics.management.webproperties.list", "path": "management/accounts/{accountId}/webproperties", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}}, "response": {"$ref": "Webproperties"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}, "patch": {"id": "analytics.management.webproperties.patch", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", "httpMethod": "PATCH", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Webproperty"}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}, "update": {"id": "analytics.management.webproperties.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Webproperty"}, "response": {"$ref": "Webproperty"}, "scopes": ["https://www.googleapis.com/auth/analytics"]}}}', true)); |
|
| 1242 | + $this->management_webpropertyUserLinks = new Google_ManagementWebpropertyUserLinksServiceResource($this, $this->serviceName, 'webpropertyUserLinks', json_decode('{"methods": {"delete": {"id": "analytics.management.webpropertyUserLinks.delete", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", "httpMethod": "DELETE", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "insert": {"id": "analytics.management.webpropertyUserLinks.insert", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", "httpMethod": "POST", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "list": {"id": "analytics.management.webpropertyUserLinks.list", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", "httpMethod": "GET", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "max-results": {"type": "integer", "format": "int32", "location": "query"}, "start-index": {"type": "integer", "format": "int32", "minimum": "1", "location": "query"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "EntityUserLinks"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}, "update": {"id": "analytics.management.webpropertyUserLinks.update", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", "httpMethod": "PUT", "parameters": {"accountId": {"type": "string", "required": true, "location": "path"}, "linkId": {"type": "string", "required": true, "location": "path"}, "webPropertyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "EntityUserLink"}, "response": {"$ref": "EntityUserLink"}, "scopes": ["https://www.googleapis.com/auth/analytics.manage.users"]}}}', true)); |
|
| 1243 | + $this->metadata_columns = new Google_MetadataColumnsServiceResource($this, $this->serviceName, 'columns', json_decode('{"methods": {"list": {"id": "analytics.metadata.columns.list", "path": "metadata/{reportType}/columns", "httpMethod": "GET", "parameters": {"reportType": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Columns"}, "scopes": ["https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly"]}}}', true)); |
|
| 1244 | 1244 | |
| 1245 | 1245 | } |
| 1246 | 1246 | } |
@@ -1261,52 +1261,52 @@ discard block |
||
| 1261 | 1261 | public $selfLink; |
| 1262 | 1262 | public $updated; |
| 1263 | 1263 | public function setChildLink(Google_AccountChildLink $childLink) { |
| 1264 | - $this->childLink = $childLink; |
|
| 1264 | + $this->childLink = $childLink; |
|
| 1265 | 1265 | } |
| 1266 | 1266 | public function getChildLink() { |
| 1267 | - return $this->childLink; |
|
| 1267 | + return $this->childLink; |
|
| 1268 | 1268 | } |
| 1269 | 1269 | public function setCreated( $created) { |
| 1270 | - $this->created = $created; |
|
| 1270 | + $this->created = $created; |
|
| 1271 | 1271 | } |
| 1272 | 1272 | public function getCreated() { |
| 1273 | - return $this->created; |
|
| 1273 | + return $this->created; |
|
| 1274 | 1274 | } |
| 1275 | 1275 | public function setId( $id) { |
| 1276 | - $this->id = $id; |
|
| 1276 | + $this->id = $id; |
|
| 1277 | 1277 | } |
| 1278 | 1278 | public function getId() { |
| 1279 | - return $this->id; |
|
| 1279 | + return $this->id; |
|
| 1280 | 1280 | } |
| 1281 | 1281 | public function setKind( $kind) { |
| 1282 | - $this->kind = $kind; |
|
| 1282 | + $this->kind = $kind; |
|
| 1283 | 1283 | } |
| 1284 | 1284 | public function getKind() { |
| 1285 | - return $this->kind; |
|
| 1285 | + return $this->kind; |
|
| 1286 | 1286 | } |
| 1287 | 1287 | public function setName( $name) { |
| 1288 | - $this->name = $name; |
|
| 1288 | + $this->name = $name; |
|
| 1289 | 1289 | } |
| 1290 | 1290 | public function getName() { |
| 1291 | - return $this->name; |
|
| 1291 | + return $this->name; |
|
| 1292 | 1292 | } |
| 1293 | 1293 | public function setPermissions(Google_AccountPermissions $permissions) { |
| 1294 | - $this->permissions = $permissions; |
|
| 1294 | + $this->permissions = $permissions; |
|
| 1295 | 1295 | } |
| 1296 | 1296 | public function getPermissions() { |
| 1297 | - return $this->permissions; |
|
| 1297 | + return $this->permissions; |
|
| 1298 | 1298 | } |
| 1299 | 1299 | public function setSelfLink( $selfLink) { |
| 1300 | - $this->selfLink = $selfLink; |
|
| 1300 | + $this->selfLink = $selfLink; |
|
| 1301 | 1301 | } |
| 1302 | 1302 | public function getSelfLink() { |
| 1303 | - return $this->selfLink; |
|
| 1303 | + return $this->selfLink; |
|
| 1304 | 1304 | } |
| 1305 | 1305 | public function setUpdated( $updated) { |
| 1306 | - $this->updated = $updated; |
|
| 1306 | + $this->updated = $updated; |
|
| 1307 | 1307 | } |
| 1308 | 1308 | public function getUpdated() { |
| 1309 | - return $this->updated; |
|
| 1309 | + return $this->updated; |
|
| 1310 | 1310 | } |
| 1311 | 1311 | } |
| 1312 | 1312 | |
@@ -1314,27 +1314,27 @@ discard block |
||
| 1314 | 1314 | public $href; |
| 1315 | 1315 | public $type; |
| 1316 | 1316 | public function setHref( $href) { |
| 1317 | - $this->href = $href; |
|
| 1317 | + $this->href = $href; |
|
| 1318 | 1318 | } |
| 1319 | 1319 | public function getHref() { |
| 1320 | - return $this->href; |
|
| 1320 | + return $this->href; |
|
| 1321 | 1321 | } |
| 1322 | 1322 | public function setType( $type) { |
| 1323 | - $this->type = $type; |
|
| 1323 | + $this->type = $type; |
|
| 1324 | 1324 | } |
| 1325 | 1325 | public function getType() { |
| 1326 | - return $this->type; |
|
| 1326 | + return $this->type; |
|
| 1327 | 1327 | } |
| 1328 | 1328 | } |
| 1329 | 1329 | |
| 1330 | 1330 | class Google_AccountPermissions extends Google_Model { |
| 1331 | 1331 | public $effective; |
| 1332 | 1332 | public function setEffective(/* array(Google_string) */ $effective) { |
| 1333 | - $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 1334 | - $this->effective = $effective; |
|
| 1333 | + $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 1334 | + $this->effective = $effective; |
|
| 1335 | 1335 | } |
| 1336 | 1336 | public function getEffective() { |
| 1337 | - return $this->effective; |
|
| 1337 | + return $this->effective; |
|
| 1338 | 1338 | } |
| 1339 | 1339 | } |
| 1340 | 1340 | |
@@ -1344,28 +1344,28 @@ discard block |
||
| 1344 | 1344 | public $kind; |
| 1345 | 1345 | public $name; |
| 1346 | 1346 | public function setHref( $href) { |
| 1347 | - $this->href = $href; |
|
| 1347 | + $this->href = $href; |
|
| 1348 | 1348 | } |
| 1349 | 1349 | public function getHref() { |
| 1350 | - return $this->href; |
|
| 1350 | + return $this->href; |
|
| 1351 | 1351 | } |
| 1352 | 1352 | public function setId( $id) { |
| 1353 | - $this->id = $id; |
|
| 1353 | + $this->id = $id; |
|
| 1354 | 1354 | } |
| 1355 | 1355 | public function getId() { |
| 1356 | - return $this->id; |
|
| 1356 | + return $this->id; |
|
| 1357 | 1357 | } |
| 1358 | 1358 | public function setKind( $kind) { |
| 1359 | - $this->kind = $kind; |
|
| 1359 | + $this->kind = $kind; |
|
| 1360 | 1360 | } |
| 1361 | 1361 | public function getKind() { |
| 1362 | - return $this->kind; |
|
| 1362 | + return $this->kind; |
|
| 1363 | 1363 | } |
| 1364 | 1364 | public function setName( $name) { |
| 1365 | - $this->name = $name; |
|
| 1365 | + $this->name = $name; |
|
| 1366 | 1366 | } |
| 1367 | 1367 | public function getName() { |
| 1368 | - return $this->name; |
|
| 1368 | + return $this->name; |
|
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | 1371 | |
@@ -1381,64 +1381,64 @@ discard block |
||
| 1381 | 1381 | public $totalResults; |
| 1382 | 1382 | public $username; |
| 1383 | 1383 | public function setItems(/* array(Google_Account) */ $items) { |
| 1384 | - $this->assertIsArray($items, 'Google_Account', __METHOD__); |
|
| 1385 | - $this->items = $items; |
|
| 1384 | + $this->assertIsArray($items, 'Google_Account', __METHOD__); |
|
| 1385 | + $this->items = $items; |
|
| 1386 | 1386 | } |
| 1387 | 1387 | public function getItems() { |
| 1388 | - return $this->items; |
|
| 1388 | + return $this->items; |
|
| 1389 | 1389 | } |
| 1390 | 1390 | public function setItemsPerPage( $itemsPerPage) { |
| 1391 | - $this->itemsPerPage = $itemsPerPage; |
|
| 1391 | + $this->itemsPerPage = $itemsPerPage; |
|
| 1392 | 1392 | } |
| 1393 | 1393 | public function getItemsPerPage() { |
| 1394 | - return $this->itemsPerPage; |
|
| 1394 | + return $this->itemsPerPage; |
|
| 1395 | 1395 | } |
| 1396 | 1396 | public function setKind( $kind) { |
| 1397 | - $this->kind = $kind; |
|
| 1397 | + $this->kind = $kind; |
|
| 1398 | 1398 | } |
| 1399 | 1399 | public function getKind() { |
| 1400 | - return $this->kind; |
|
| 1400 | + return $this->kind; |
|
| 1401 | 1401 | } |
| 1402 | 1402 | public function setNextLink( $nextLink) { |
| 1403 | - $this->nextLink = $nextLink; |
|
| 1403 | + $this->nextLink = $nextLink; |
|
| 1404 | 1404 | } |
| 1405 | 1405 | public function getNextLink() { |
| 1406 | - return $this->nextLink; |
|
| 1406 | + return $this->nextLink; |
|
| 1407 | 1407 | } |
| 1408 | 1408 | public function setPreviousLink( $previousLink) { |
| 1409 | - $this->previousLink = $previousLink; |
|
| 1409 | + $this->previousLink = $previousLink; |
|
| 1410 | 1410 | } |
| 1411 | 1411 | public function getPreviousLink() { |
| 1412 | - return $this->previousLink; |
|
| 1412 | + return $this->previousLink; |
|
| 1413 | 1413 | } |
| 1414 | 1414 | public function setStartIndex( $startIndex) { |
| 1415 | - $this->startIndex = $startIndex; |
|
| 1415 | + $this->startIndex = $startIndex; |
|
| 1416 | 1416 | } |
| 1417 | 1417 | public function getStartIndex() { |
| 1418 | - return $this->startIndex; |
|
| 1418 | + return $this->startIndex; |
|
| 1419 | 1419 | } |
| 1420 | 1420 | public function setTotalResults( $totalResults) { |
| 1421 | - $this->totalResults = $totalResults; |
|
| 1421 | + $this->totalResults = $totalResults; |
|
| 1422 | 1422 | } |
| 1423 | 1423 | public function getTotalResults() { |
| 1424 | - return $this->totalResults; |
|
| 1424 | + return $this->totalResults; |
|
| 1425 | 1425 | } |
| 1426 | 1426 | public function setUsername( $username) { |
| 1427 | - $this->username = $username; |
|
| 1427 | + $this->username = $username; |
|
| 1428 | 1428 | } |
| 1429 | 1429 | public function getUsername() { |
| 1430 | - return $this->username; |
|
| 1430 | + return $this->username; |
|
| 1431 | 1431 | } |
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | 1434 | class Google_AnalyticsDataimportDeleteUploadDataRequest extends Google_Model { |
| 1435 | 1435 | public $customDataImportUids; |
| 1436 | 1436 | public function setCustomDataImportUids(/* array(Google_string) */ $customDataImportUids) { |
| 1437 | - $this->assertIsArray($customDataImportUids, 'Google_string', __METHOD__); |
|
| 1438 | - $this->customDataImportUids = $customDataImportUids; |
|
| 1437 | + $this->assertIsArray($customDataImportUids, 'Google_string', __METHOD__); |
|
| 1438 | + $this->customDataImportUids = $customDataImportUids; |
|
| 1439 | 1439 | } |
| 1440 | 1440 | public function getCustomDataImportUids() { |
| 1441 | - return $this->customDataImportUids; |
|
| 1441 | + return $this->customDataImportUids; |
|
| 1442 | 1442 | } |
| 1443 | 1443 | } |
| 1444 | 1444 | |
@@ -1447,22 +1447,22 @@ discard block |
||
| 1447 | 1447 | public $id; |
| 1448 | 1448 | public $kind; |
| 1449 | 1449 | public function setAttributes( $attributes) { |
| 1450 | - $this->attributes = $attributes; |
|
| 1450 | + $this->attributes = $attributes; |
|
| 1451 | 1451 | } |
| 1452 | 1452 | public function getAttributes() { |
| 1453 | - return $this->attributes; |
|
| 1453 | + return $this->attributes; |
|
| 1454 | 1454 | } |
| 1455 | 1455 | public function setId( $id) { |
| 1456 | - $this->id = $id; |
|
| 1456 | + $this->id = $id; |
|
| 1457 | 1457 | } |
| 1458 | 1458 | public function getId() { |
| 1459 | - return $this->id; |
|
| 1459 | + return $this->id; |
|
| 1460 | 1460 | } |
| 1461 | 1461 | public function setKind( $kind) { |
| 1462 | - $this->kind = $kind; |
|
| 1462 | + $this->kind = $kind; |
|
| 1463 | 1463 | } |
| 1464 | 1464 | public function getKind() { |
| 1465 | - return $this->kind; |
|
| 1465 | + return $this->kind; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | } |
| 1468 | 1468 | |
@@ -1475,36 +1475,36 @@ discard block |
||
| 1475 | 1475 | public $kind; |
| 1476 | 1476 | public $totalResults; |
| 1477 | 1477 | public function setAttributeNames(/* array(Google_string) */ $attributeNames) { |
| 1478 | - $this->assertIsArray($attributeNames, 'Google_string', __METHOD__); |
|
| 1479 | - $this->attributeNames = $attributeNames; |
|
| 1478 | + $this->assertIsArray($attributeNames, 'Google_string', __METHOD__); |
|
| 1479 | + $this->attributeNames = $attributeNames; |
|
| 1480 | 1480 | } |
| 1481 | 1481 | public function getAttributeNames() { |
| 1482 | - return $this->attributeNames; |
|
| 1482 | + return $this->attributeNames; |
|
| 1483 | 1483 | } |
| 1484 | 1484 | public function setEtag( $etag) { |
| 1485 | - $this->etag = $etag; |
|
| 1485 | + $this->etag = $etag; |
|
| 1486 | 1486 | } |
| 1487 | 1487 | public function getEtag() { |
| 1488 | - return $this->etag; |
|
| 1488 | + return $this->etag; |
|
| 1489 | 1489 | } |
| 1490 | 1490 | public function setItems(/* array(Google_Column) */ $items) { |
| 1491 | - $this->assertIsArray($items, 'Google_Column', __METHOD__); |
|
| 1492 | - $this->items = $items; |
|
| 1491 | + $this->assertIsArray($items, 'Google_Column', __METHOD__); |
|
| 1492 | + $this->items = $items; |
|
| 1493 | 1493 | } |
| 1494 | 1494 | public function getItems() { |
| 1495 | - return $this->items; |
|
| 1495 | + return $this->items; |
|
| 1496 | 1496 | } |
| 1497 | 1497 | public function setKind( $kind) { |
| 1498 | - $this->kind = $kind; |
|
| 1498 | + $this->kind = $kind; |
|
| 1499 | 1499 | } |
| 1500 | 1500 | public function getKind() { |
| 1501 | - return $this->kind; |
|
| 1501 | + return $this->kind; |
|
| 1502 | 1502 | } |
| 1503 | 1503 | public function setTotalResults( $totalResults) { |
| 1504 | - $this->totalResults = $totalResults; |
|
| 1504 | + $this->totalResults = $totalResults; |
|
| 1505 | 1505 | } |
| 1506 | 1506 | public function getTotalResults() { |
| 1507 | - return $this->totalResults; |
|
| 1507 | + return $this->totalResults; |
|
| 1508 | 1508 | } |
| 1509 | 1509 | } |
| 1510 | 1510 | |
@@ -1527,83 +1527,83 @@ discard block |
||
| 1527 | 1527 | public $updated; |
| 1528 | 1528 | public $webPropertyId; |
| 1529 | 1529 | public function setAccountId( $accountId) { |
| 1530 | - $this->accountId = $accountId; |
|
| 1530 | + $this->accountId = $accountId; |
|
| 1531 | 1531 | } |
| 1532 | 1532 | public function getAccountId() { |
| 1533 | - return $this->accountId; |
|
| 1533 | + return $this->accountId; |
|
| 1534 | 1534 | } |
| 1535 | 1535 | public function setChildLink(Google_CustomDataSourceChildLink $childLink) { |
| 1536 | - $this->childLink = $childLink; |
|
| 1536 | + $this->childLink = $childLink; |
|
| 1537 | 1537 | } |
| 1538 | 1538 | public function getChildLink() { |
| 1539 | - return $this->childLink; |
|
| 1539 | + return $this->childLink; |
|
| 1540 | 1540 | } |
| 1541 | 1541 | public function setCreated( $created) { |
| 1542 | - $this->created = $created; |
|
| 1542 | + $this->created = $created; |
|
| 1543 | 1543 | } |
| 1544 | 1544 | public function getCreated() { |
| 1545 | - return $this->created; |
|
| 1545 | + return $this->created; |
|
| 1546 | 1546 | } |
| 1547 | 1547 | public function setDescription( $description) { |
| 1548 | - $this->description = $description; |
|
| 1548 | + $this->description = $description; |
|
| 1549 | 1549 | } |
| 1550 | 1550 | public function getDescription() { |
| 1551 | - return $this->description; |
|
| 1551 | + return $this->description; |
|
| 1552 | 1552 | } |
| 1553 | 1553 | public function setId( $id) { |
| 1554 | - $this->id = $id; |
|
| 1554 | + $this->id = $id; |
|
| 1555 | 1555 | } |
| 1556 | 1556 | public function getId() { |
| 1557 | - return $this->id; |
|
| 1557 | + return $this->id; |
|
| 1558 | 1558 | } |
| 1559 | 1559 | public function setKind( $kind) { |
| 1560 | - $this->kind = $kind; |
|
| 1560 | + $this->kind = $kind; |
|
| 1561 | 1561 | } |
| 1562 | 1562 | public function getKind() { |
| 1563 | - return $this->kind; |
|
| 1563 | + return $this->kind; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | public function setName( $name) { |
| 1566 | - $this->name = $name; |
|
| 1566 | + $this->name = $name; |
|
| 1567 | 1567 | } |
| 1568 | 1568 | public function getName() { |
| 1569 | - return $this->name; |
|
| 1569 | + return $this->name; |
|
| 1570 | 1570 | } |
| 1571 | 1571 | public function setParentLink(Google_CustomDataSourceParentLink $parentLink) { |
| 1572 | - $this->parentLink = $parentLink; |
|
| 1572 | + $this->parentLink = $parentLink; |
|
| 1573 | 1573 | } |
| 1574 | 1574 | public function getParentLink() { |
| 1575 | - return $this->parentLink; |
|
| 1575 | + return $this->parentLink; |
|
| 1576 | 1576 | } |
| 1577 | 1577 | public function setProfilesLinked(/* array(Google_string) */ $profilesLinked) { |
| 1578 | - $this->assertIsArray($profilesLinked, 'Google_string', __METHOD__); |
|
| 1579 | - $this->profilesLinked = $profilesLinked; |
|
| 1578 | + $this->assertIsArray($profilesLinked, 'Google_string', __METHOD__); |
|
| 1579 | + $this->profilesLinked = $profilesLinked; |
|
| 1580 | 1580 | } |
| 1581 | 1581 | public function getProfilesLinked() { |
| 1582 | - return $this->profilesLinked; |
|
| 1582 | + return $this->profilesLinked; |
|
| 1583 | 1583 | } |
| 1584 | 1584 | public function setSelfLink( $selfLink) { |
| 1585 | - $this->selfLink = $selfLink; |
|
| 1585 | + $this->selfLink = $selfLink; |
|
| 1586 | 1586 | } |
| 1587 | 1587 | public function getSelfLink() { |
| 1588 | - return $this->selfLink; |
|
| 1588 | + return $this->selfLink; |
|
| 1589 | 1589 | } |
| 1590 | 1590 | public function setType( $type) { |
| 1591 | - $this->type = $type; |
|
| 1591 | + $this->type = $type; |
|
| 1592 | 1592 | } |
| 1593 | 1593 | public function getType() { |
| 1594 | - return $this->type; |
|
| 1594 | + return $this->type; |
|
| 1595 | 1595 | } |
| 1596 | 1596 | public function setUpdated( $updated) { |
| 1597 | - $this->updated = $updated; |
|
| 1597 | + $this->updated = $updated; |
|
| 1598 | 1598 | } |
| 1599 | 1599 | public function getUpdated() { |
| 1600 | - return $this->updated; |
|
| 1600 | + return $this->updated; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | public function setWebPropertyId( $webPropertyId) { |
| 1603 | - $this->webPropertyId = $webPropertyId; |
|
| 1603 | + $this->webPropertyId = $webPropertyId; |
|
| 1604 | 1604 | } |
| 1605 | 1605 | public function getWebPropertyId() { |
| 1606 | - return $this->webPropertyId; |
|
| 1606 | + return $this->webPropertyId; |
|
| 1607 | 1607 | } |
| 1608 | 1608 | } |
| 1609 | 1609 | |
@@ -1611,16 +1611,16 @@ discard block |
||
| 1611 | 1611 | public $href; |
| 1612 | 1612 | public $type; |
| 1613 | 1613 | public function setHref( $href) { |
| 1614 | - $this->href = $href; |
|
| 1614 | + $this->href = $href; |
|
| 1615 | 1615 | } |
| 1616 | 1616 | public function getHref() { |
| 1617 | - return $this->href; |
|
| 1617 | + return $this->href; |
|
| 1618 | 1618 | } |
| 1619 | 1619 | public function setType( $type) { |
| 1620 | - $this->type = $type; |
|
| 1620 | + $this->type = $type; |
|
| 1621 | 1621 | } |
| 1622 | 1622 | public function getType() { |
| 1623 | - return $this->type; |
|
| 1623 | + return $this->type; |
|
| 1624 | 1624 | } |
| 1625 | 1625 | } |
| 1626 | 1626 | |
@@ -1628,16 +1628,16 @@ discard block |
||
| 1628 | 1628 | public $href; |
| 1629 | 1629 | public $type; |
| 1630 | 1630 | public function setHref( $href) { |
| 1631 | - $this->href = $href; |
|
| 1631 | + $this->href = $href; |
|
| 1632 | 1632 | } |
| 1633 | 1633 | public function getHref() { |
| 1634 | - return $this->href; |
|
| 1634 | + return $this->href; |
|
| 1635 | 1635 | } |
| 1636 | 1636 | public function setType( $type) { |
| 1637 | - $this->type = $type; |
|
| 1637 | + $this->type = $type; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | public function getType() { |
| 1640 | - return $this->type; |
|
| 1640 | + return $this->type; |
|
| 1641 | 1641 | } |
| 1642 | 1642 | } |
| 1643 | 1643 | |
@@ -1653,53 +1653,53 @@ discard block |
||
| 1653 | 1653 | public $totalResults; |
| 1654 | 1654 | public $username; |
| 1655 | 1655 | public function setItems(/* array(Google_CustomDataSource) */ $items) { |
| 1656 | - $this->assertIsArray($items, 'Google_CustomDataSource', __METHOD__); |
|
| 1657 | - $this->items = $items; |
|
| 1656 | + $this->assertIsArray($items, 'Google_CustomDataSource', __METHOD__); |
|
| 1657 | + $this->items = $items; |
|
| 1658 | 1658 | } |
| 1659 | 1659 | public function getItems() { |
| 1660 | - return $this->items; |
|
| 1660 | + return $this->items; |
|
| 1661 | 1661 | } |
| 1662 | 1662 | public function setItemsPerPage( $itemsPerPage) { |
| 1663 | - $this->itemsPerPage = $itemsPerPage; |
|
| 1663 | + $this->itemsPerPage = $itemsPerPage; |
|
| 1664 | 1664 | } |
| 1665 | 1665 | public function getItemsPerPage() { |
| 1666 | - return $this->itemsPerPage; |
|
| 1666 | + return $this->itemsPerPage; |
|
| 1667 | 1667 | } |
| 1668 | 1668 | public function setKind( $kind) { |
| 1669 | - $this->kind = $kind; |
|
| 1669 | + $this->kind = $kind; |
|
| 1670 | 1670 | } |
| 1671 | 1671 | public function getKind() { |
| 1672 | - return $this->kind; |
|
| 1672 | + return $this->kind; |
|
| 1673 | 1673 | } |
| 1674 | 1674 | public function setNextLink( $nextLink) { |
| 1675 | - $this->nextLink = $nextLink; |
|
| 1675 | + $this->nextLink = $nextLink; |
|
| 1676 | 1676 | } |
| 1677 | 1677 | public function getNextLink() { |
| 1678 | - return $this->nextLink; |
|
| 1678 | + return $this->nextLink; |
|
| 1679 | 1679 | } |
| 1680 | 1680 | public function setPreviousLink( $previousLink) { |
| 1681 | - $this->previousLink = $previousLink; |
|
| 1681 | + $this->previousLink = $previousLink; |
|
| 1682 | 1682 | } |
| 1683 | 1683 | public function getPreviousLink() { |
| 1684 | - return $this->previousLink; |
|
| 1684 | + return $this->previousLink; |
|
| 1685 | 1685 | } |
| 1686 | 1686 | public function setStartIndex( $startIndex) { |
| 1687 | - $this->startIndex = $startIndex; |
|
| 1687 | + $this->startIndex = $startIndex; |
|
| 1688 | 1688 | } |
| 1689 | 1689 | public function getStartIndex() { |
| 1690 | - return $this->startIndex; |
|
| 1690 | + return $this->startIndex; |
|
| 1691 | 1691 | } |
| 1692 | 1692 | public function setTotalResults( $totalResults) { |
| 1693 | - $this->totalResults = $totalResults; |
|
| 1693 | + $this->totalResults = $totalResults; |
|
| 1694 | 1694 | } |
| 1695 | 1695 | public function getTotalResults() { |
| 1696 | - return $this->totalResults; |
|
| 1696 | + return $this->totalResults; |
|
| 1697 | 1697 | } |
| 1698 | 1698 | public function setUsername( $username) { |
| 1699 | - $this->username = $username; |
|
| 1699 | + $this->username = $username; |
|
| 1700 | 1700 | } |
| 1701 | 1701 | public function getUsername() { |
| 1702 | - return $this->username; |
|
| 1702 | + return $this->username; |
|
| 1703 | 1703 | } |
| 1704 | 1704 | } |
| 1705 | 1705 | |
@@ -1720,71 +1720,71 @@ discard block |
||
| 1720 | 1720 | public $selfLink; |
| 1721 | 1721 | public $webPropertyId; |
| 1722 | 1722 | public function setAccountId( $accountId) { |
| 1723 | - $this->accountId = $accountId; |
|
| 1723 | + $this->accountId = $accountId; |
|
| 1724 | 1724 | } |
| 1725 | 1725 | public function getAccountId() { |
| 1726 | - return $this->accountId; |
|
| 1726 | + return $this->accountId; |
|
| 1727 | 1727 | } |
| 1728 | 1728 | public function setAppendCount( $appendCount) { |
| 1729 | - $this->appendCount = $appendCount; |
|
| 1729 | + $this->appendCount = $appendCount; |
|
| 1730 | 1730 | } |
| 1731 | 1731 | public function getAppendCount() { |
| 1732 | - return $this->appendCount; |
|
| 1732 | + return $this->appendCount; |
|
| 1733 | 1733 | } |
| 1734 | 1734 | public function setCreatedTime( $createdTime) { |
| 1735 | - $this->createdTime = $createdTime; |
|
| 1735 | + $this->createdTime = $createdTime; |
|
| 1736 | 1736 | } |
| 1737 | 1737 | public function getCreatedTime() { |
| 1738 | - return $this->createdTime; |
|
| 1738 | + return $this->createdTime; |
|
| 1739 | 1739 | } |
| 1740 | 1740 | public function setCustomDataSourceId( $customDataSourceId) { |
| 1741 | - $this->customDataSourceId = $customDataSourceId; |
|
| 1741 | + $this->customDataSourceId = $customDataSourceId; |
|
| 1742 | 1742 | } |
| 1743 | 1743 | public function getCustomDataSourceId() { |
| 1744 | - return $this->customDataSourceId; |
|
| 1744 | + return $this->customDataSourceId; |
|
| 1745 | 1745 | } |
| 1746 | 1746 | public function setDate( $date) { |
| 1747 | - $this->date = $date; |
|
| 1747 | + $this->date = $date; |
|
| 1748 | 1748 | } |
| 1749 | 1749 | public function getDate() { |
| 1750 | - return $this->date; |
|
| 1750 | + return $this->date; |
|
| 1751 | 1751 | } |
| 1752 | 1752 | public function setKind( $kind) { |
| 1753 | - $this->kind = $kind; |
|
| 1753 | + $this->kind = $kind; |
|
| 1754 | 1754 | } |
| 1755 | 1755 | public function getKind() { |
| 1756 | - return $this->kind; |
|
| 1756 | + return $this->kind; |
|
| 1757 | 1757 | } |
| 1758 | 1758 | public function setModifiedTime( $modifiedTime) { |
| 1759 | - $this->modifiedTime = $modifiedTime; |
|
| 1759 | + $this->modifiedTime = $modifiedTime; |
|
| 1760 | 1760 | } |
| 1761 | 1761 | public function getModifiedTime() { |
| 1762 | - return $this->modifiedTime; |
|
| 1762 | + return $this->modifiedTime; |
|
| 1763 | 1763 | } |
| 1764 | 1764 | public function setParentLink(Google_DailyUploadParentLink $parentLink) { |
| 1765 | - $this->parentLink = $parentLink; |
|
| 1765 | + $this->parentLink = $parentLink; |
|
| 1766 | 1766 | } |
| 1767 | 1767 | public function getParentLink() { |
| 1768 | - return $this->parentLink; |
|
| 1768 | + return $this->parentLink; |
|
| 1769 | 1769 | } |
| 1770 | 1770 | public function setRecentChanges(/* array(Google_DailyUploadRecentChanges) */ $recentChanges) { |
| 1771 | - $this->assertIsArray($recentChanges, 'Google_DailyUploadRecentChanges', __METHOD__); |
|
| 1772 | - $this->recentChanges = $recentChanges; |
|
| 1771 | + $this->assertIsArray($recentChanges, 'Google_DailyUploadRecentChanges', __METHOD__); |
|
| 1772 | + $this->recentChanges = $recentChanges; |
|
| 1773 | 1773 | } |
| 1774 | 1774 | public function getRecentChanges() { |
| 1775 | - return $this->recentChanges; |
|
| 1775 | + return $this->recentChanges; |
|
| 1776 | 1776 | } |
| 1777 | 1777 | public function setSelfLink( $selfLink) { |
| 1778 | - $this->selfLink = $selfLink; |
|
| 1778 | + $this->selfLink = $selfLink; |
|
| 1779 | 1779 | } |
| 1780 | 1780 | public function getSelfLink() { |
| 1781 | - return $this->selfLink; |
|
| 1781 | + return $this->selfLink; |
|
| 1782 | 1782 | } |
| 1783 | 1783 | public function setWebPropertyId( $webPropertyId) { |
| 1784 | - $this->webPropertyId = $webPropertyId; |
|
| 1784 | + $this->webPropertyId = $webPropertyId; |
|
| 1785 | 1785 | } |
| 1786 | 1786 | public function getWebPropertyId() { |
| 1787 | - return $this->webPropertyId; |
|
| 1787 | + return $this->webPropertyId; |
|
| 1788 | 1788 | } |
| 1789 | 1789 | } |
| 1790 | 1790 | |
@@ -1797,46 +1797,46 @@ discard block |
||
| 1797 | 1797 | public $nextAppendLink; |
| 1798 | 1798 | public $webPropertyId; |
| 1799 | 1799 | public function setAccountId( $accountId) { |
| 1800 | - $this->accountId = $accountId; |
|
| 1800 | + $this->accountId = $accountId; |
|
| 1801 | 1801 | } |
| 1802 | 1802 | public function getAccountId() { |
| 1803 | - return $this->accountId; |
|
| 1803 | + return $this->accountId; |
|
| 1804 | 1804 | } |
| 1805 | 1805 | public function setAppendNumber( $appendNumber) { |
| 1806 | - $this->appendNumber = $appendNumber; |
|
| 1806 | + $this->appendNumber = $appendNumber; |
|
| 1807 | 1807 | } |
| 1808 | 1808 | public function getAppendNumber() { |
| 1809 | - return $this->appendNumber; |
|
| 1809 | + return $this->appendNumber; |
|
| 1810 | 1810 | } |
| 1811 | 1811 | public function setCustomDataSourceId( $customDataSourceId) { |
| 1812 | - $this->customDataSourceId = $customDataSourceId; |
|
| 1812 | + $this->customDataSourceId = $customDataSourceId; |
|
| 1813 | 1813 | } |
| 1814 | 1814 | public function getCustomDataSourceId() { |
| 1815 | - return $this->customDataSourceId; |
|
| 1815 | + return $this->customDataSourceId; |
|
| 1816 | 1816 | } |
| 1817 | 1817 | public function setDate( $date) { |
| 1818 | - $this->date = $date; |
|
| 1818 | + $this->date = $date; |
|
| 1819 | 1819 | } |
| 1820 | 1820 | public function getDate() { |
| 1821 | - return $this->date; |
|
| 1821 | + return $this->date; |
|
| 1822 | 1822 | } |
| 1823 | 1823 | public function setKind( $kind) { |
| 1824 | - $this->kind = $kind; |
|
| 1824 | + $this->kind = $kind; |
|
| 1825 | 1825 | } |
| 1826 | 1826 | public function getKind() { |
| 1827 | - return $this->kind; |
|
| 1827 | + return $this->kind; |
|
| 1828 | 1828 | } |
| 1829 | 1829 | public function setNextAppendLink( $nextAppendLink) { |
| 1830 | - $this->nextAppendLink = $nextAppendLink; |
|
| 1830 | + $this->nextAppendLink = $nextAppendLink; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | public function getNextAppendLink() { |
| 1833 | - return $this->nextAppendLink; |
|
| 1833 | + return $this->nextAppendLink; |
|
| 1834 | 1834 | } |
| 1835 | 1835 | public function setWebPropertyId( $webPropertyId) { |
| 1836 | - $this->webPropertyId = $webPropertyId; |
|
| 1836 | + $this->webPropertyId = $webPropertyId; |
|
| 1837 | 1837 | } |
| 1838 | 1838 | public function getWebPropertyId() { |
| 1839 | - return $this->webPropertyId; |
|
| 1839 | + return $this->webPropertyId; |
|
| 1840 | 1840 | } |
| 1841 | 1841 | } |
| 1842 | 1842 | |
@@ -1844,16 +1844,16 @@ discard block |
||
| 1844 | 1844 | public $href; |
| 1845 | 1845 | public $type; |
| 1846 | 1846 | public function setHref( $href) { |
| 1847 | - $this->href = $href; |
|
| 1847 | + $this->href = $href; |
|
| 1848 | 1848 | } |
| 1849 | 1849 | public function getHref() { |
| 1850 | - return $this->href; |
|
| 1850 | + return $this->href; |
|
| 1851 | 1851 | } |
| 1852 | 1852 | public function setType( $type) { |
| 1853 | - $this->type = $type; |
|
| 1853 | + $this->type = $type; |
|
| 1854 | 1854 | } |
| 1855 | 1855 | public function getType() { |
| 1856 | - return $this->type; |
|
| 1856 | + return $this->type; |
|
| 1857 | 1857 | } |
| 1858 | 1858 | } |
| 1859 | 1859 | |
@@ -1861,16 +1861,16 @@ discard block |
||
| 1861 | 1861 | public $change; |
| 1862 | 1862 | public $time; |
| 1863 | 1863 | public function setChange( $change) { |
| 1864 | - $this->change = $change; |
|
| 1864 | + $this->change = $change; |
|
| 1865 | 1865 | } |
| 1866 | 1866 | public function getChange() { |
| 1867 | - return $this->change; |
|
| 1867 | + return $this->change; |
|
| 1868 | 1868 | } |
| 1869 | 1869 | public function setTime( $time) { |
| 1870 | - $this->time = $time; |
|
| 1870 | + $this->time = $time; |
|
| 1871 | 1871 | } |
| 1872 | 1872 | public function getTime() { |
| 1873 | - return $this->time; |
|
| 1873 | + return $this->time; |
|
| 1874 | 1874 | } |
| 1875 | 1875 | } |
| 1876 | 1876 | |
@@ -1886,53 +1886,53 @@ discard block |
||
| 1886 | 1886 | public $totalResults; |
| 1887 | 1887 | public $username; |
| 1888 | 1888 | public function setItems(/* array(Google_DailyUpload) */ $items) { |
| 1889 | - $this->assertIsArray($items, 'Google_DailyUpload', __METHOD__); |
|
| 1890 | - $this->items = $items; |
|
| 1889 | + $this->assertIsArray($items, 'Google_DailyUpload', __METHOD__); |
|
| 1890 | + $this->items = $items; |
|
| 1891 | 1891 | } |
| 1892 | 1892 | public function getItems() { |
| 1893 | - return $this->items; |
|
| 1893 | + return $this->items; |
|
| 1894 | 1894 | } |
| 1895 | 1895 | public function setItemsPerPage( $itemsPerPage) { |
| 1896 | - $this->itemsPerPage = $itemsPerPage; |
|
| 1896 | + $this->itemsPerPage = $itemsPerPage; |
|
| 1897 | 1897 | } |
| 1898 | 1898 | public function getItemsPerPage() { |
| 1899 | - return $this->itemsPerPage; |
|
| 1899 | + return $this->itemsPerPage; |
|
| 1900 | 1900 | } |
| 1901 | 1901 | public function setKind( $kind) { |
| 1902 | - $this->kind = $kind; |
|
| 1902 | + $this->kind = $kind; |
|
| 1903 | 1903 | } |
| 1904 | 1904 | public function getKind() { |
| 1905 | - return $this->kind; |
|
| 1905 | + return $this->kind; |
|
| 1906 | 1906 | } |
| 1907 | 1907 | public function setNextLink( $nextLink) { |
| 1908 | - $this->nextLink = $nextLink; |
|
| 1908 | + $this->nextLink = $nextLink; |
|
| 1909 | 1909 | } |
| 1910 | 1910 | public function getNextLink() { |
| 1911 | - return $this->nextLink; |
|
| 1911 | + return $this->nextLink; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | public function setPreviousLink( $previousLink) { |
| 1914 | - $this->previousLink = $previousLink; |
|
| 1914 | + $this->previousLink = $previousLink; |
|
| 1915 | 1915 | } |
| 1916 | 1916 | public function getPreviousLink() { |
| 1917 | - return $this->previousLink; |
|
| 1917 | + return $this->previousLink; |
|
| 1918 | 1918 | } |
| 1919 | 1919 | public function setStartIndex( $startIndex) { |
| 1920 | - $this->startIndex = $startIndex; |
|
| 1920 | + $this->startIndex = $startIndex; |
|
| 1921 | 1921 | } |
| 1922 | 1922 | public function getStartIndex() { |
| 1923 | - return $this->startIndex; |
|
| 1923 | + return $this->startIndex; |
|
| 1924 | 1924 | } |
| 1925 | 1925 | public function setTotalResults( $totalResults) { |
| 1926 | - $this->totalResults = $totalResults; |
|
| 1926 | + $this->totalResults = $totalResults; |
|
| 1927 | 1927 | } |
| 1928 | 1928 | public function getTotalResults() { |
| 1929 | - return $this->totalResults; |
|
| 1929 | + return $this->totalResults; |
|
| 1930 | 1930 | } |
| 1931 | 1931 | public function setUsername( $username) { |
| 1932 | - $this->username = $username; |
|
| 1932 | + $this->username = $username; |
|
| 1933 | 1933 | } |
| 1934 | 1934 | public function getUsername() { |
| 1935 | - return $this->username; |
|
| 1935 | + return $this->username; |
|
| 1936 | 1936 | } |
| 1937 | 1937 | } |
| 1938 | 1938 | |
@@ -1950,40 +1950,40 @@ discard block |
||
| 1950 | 1950 | protected $__userRefDataType = ''; |
| 1951 | 1951 | public $userRef; |
| 1952 | 1952 | public function setEntity(Google_EntityUserLinkEntity $entity) { |
| 1953 | - $this->entity = $entity; |
|
| 1953 | + $this->entity = $entity; |
|
| 1954 | 1954 | } |
| 1955 | 1955 | public function getEntity() { |
| 1956 | - return $this->entity; |
|
| 1956 | + return $this->entity; |
|
| 1957 | 1957 | } |
| 1958 | 1958 | public function setId( $id) { |
| 1959 | - $this->id = $id; |
|
| 1959 | + $this->id = $id; |
|
| 1960 | 1960 | } |
| 1961 | 1961 | public function getId() { |
| 1962 | - return $this->id; |
|
| 1962 | + return $this->id; |
|
| 1963 | 1963 | } |
| 1964 | 1964 | public function setKind( $kind) { |
| 1965 | - $this->kind = $kind; |
|
| 1965 | + $this->kind = $kind; |
|
| 1966 | 1966 | } |
| 1967 | 1967 | public function getKind() { |
| 1968 | - return $this->kind; |
|
| 1968 | + return $this->kind; |
|
| 1969 | 1969 | } |
| 1970 | 1970 | public function setPermissions(Google_EntityUserLinkPermissions $permissions) { |
| 1971 | - $this->permissions = $permissions; |
|
| 1971 | + $this->permissions = $permissions; |
|
| 1972 | 1972 | } |
| 1973 | 1973 | public function getPermissions() { |
| 1974 | - return $this->permissions; |
|
| 1974 | + return $this->permissions; |
|
| 1975 | 1975 | } |
| 1976 | 1976 | public function setSelfLink( $selfLink) { |
| 1977 | - $this->selfLink = $selfLink; |
|
| 1977 | + $this->selfLink = $selfLink; |
|
| 1978 | 1978 | } |
| 1979 | 1979 | public function getSelfLink() { |
| 1980 | - return $this->selfLink; |
|
| 1980 | + return $this->selfLink; |
|
| 1981 | 1981 | } |
| 1982 | 1982 | public function setUserRef(Google_UserRef $userRef) { |
| 1983 | - $this->userRef = $userRef; |
|
| 1983 | + $this->userRef = $userRef; |
|
| 1984 | 1984 | } |
| 1985 | 1985 | public function getUserRef() { |
| 1986 | - return $this->userRef; |
|
| 1986 | + return $this->userRef; |
|
| 1987 | 1987 | } |
| 1988 | 1988 | } |
| 1989 | 1989 | |
@@ -1998,22 +1998,22 @@ discard block |
||
| 1998 | 1998 | protected $__webPropertyRefDataType = ''; |
| 1999 | 1999 | public $webPropertyRef; |
| 2000 | 2000 | public function setAccountRef(Google_AccountRef $accountRef) { |
| 2001 | - $this->accountRef = $accountRef; |
|
| 2001 | + $this->accountRef = $accountRef; |
|
| 2002 | 2002 | } |
| 2003 | 2003 | public function getAccountRef() { |
| 2004 | - return $this->accountRef; |
|
| 2004 | + return $this->accountRef; |
|
| 2005 | 2005 | } |
| 2006 | 2006 | public function setProfileRef(Google_ProfileRef $profileRef) { |
| 2007 | - $this->profileRef = $profileRef; |
|
| 2007 | + $this->profileRef = $profileRef; |
|
| 2008 | 2008 | } |
| 2009 | 2009 | public function getProfileRef() { |
| 2010 | - return $this->profileRef; |
|
| 2010 | + return $this->profileRef; |
|
| 2011 | 2011 | } |
| 2012 | 2012 | public function setWebPropertyRef(Google_WebPropertyRef $webPropertyRef) { |
| 2013 | - $this->webPropertyRef = $webPropertyRef; |
|
| 2013 | + $this->webPropertyRef = $webPropertyRef; |
|
| 2014 | 2014 | } |
| 2015 | 2015 | public function getWebPropertyRef() { |
| 2016 | - return $this->webPropertyRef; |
|
| 2016 | + return $this->webPropertyRef; |
|
| 2017 | 2017 | } |
| 2018 | 2018 | } |
| 2019 | 2019 | |
@@ -2021,18 +2021,18 @@ discard block |
||
| 2021 | 2021 | public $effective; |
| 2022 | 2022 | public $local; |
| 2023 | 2023 | public function setEffective(/* array(Google_string) */ $effective) { |
| 2024 | - $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 2025 | - $this->effective = $effective; |
|
| 2024 | + $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 2025 | + $this->effective = $effective; |
|
| 2026 | 2026 | } |
| 2027 | 2027 | public function getEffective() { |
| 2028 | - return $this->effective; |
|
| 2028 | + return $this->effective; |
|
| 2029 | 2029 | } |
| 2030 | 2030 | public function setLocal(/* array(Google_string) */ $local) { |
| 2031 | - $this->assertIsArray($local, 'Google_string', __METHOD__); |
|
| 2032 | - $this->local = $local; |
|
| 2031 | + $this->assertIsArray($local, 'Google_string', __METHOD__); |
|
| 2032 | + $this->local = $local; |
|
| 2033 | 2033 | } |
| 2034 | 2034 | public function getLocal() { |
| 2035 | - return $this->local; |
|
| 2035 | + return $this->local; |
|
| 2036 | 2036 | } |
| 2037 | 2037 | } |
| 2038 | 2038 | |
@@ -2047,47 +2047,47 @@ discard block |
||
| 2047 | 2047 | public $startIndex; |
| 2048 | 2048 | public $totalResults; |
| 2049 | 2049 | public function setItems(/* array(Google_EntityUserLink) */ $items) { |
| 2050 | - $this->assertIsArray($items, 'Google_EntityUserLink', __METHOD__); |
|
| 2051 | - $this->items = $items; |
|
| 2050 | + $this->assertIsArray($items, 'Google_EntityUserLink', __METHOD__); |
|
| 2051 | + $this->items = $items; |
|
| 2052 | 2052 | } |
| 2053 | 2053 | public function getItems() { |
| 2054 | - return $this->items; |
|
| 2054 | + return $this->items; |
|
| 2055 | 2055 | } |
| 2056 | 2056 | public function setItemsPerPage( $itemsPerPage) { |
| 2057 | - $this->itemsPerPage = $itemsPerPage; |
|
| 2057 | + $this->itemsPerPage = $itemsPerPage; |
|
| 2058 | 2058 | } |
| 2059 | 2059 | public function getItemsPerPage() { |
| 2060 | - return $this->itemsPerPage; |
|
| 2060 | + return $this->itemsPerPage; |
|
| 2061 | 2061 | } |
| 2062 | 2062 | public function setKind( $kind) { |
| 2063 | - $this->kind = $kind; |
|
| 2063 | + $this->kind = $kind; |
|
| 2064 | 2064 | } |
| 2065 | 2065 | public function getKind() { |
| 2066 | - return $this->kind; |
|
| 2066 | + return $this->kind; |
|
| 2067 | 2067 | } |
| 2068 | 2068 | public function setNextLink( $nextLink) { |
| 2069 | - $this->nextLink = $nextLink; |
|
| 2069 | + $this->nextLink = $nextLink; |
|
| 2070 | 2070 | } |
| 2071 | 2071 | public function getNextLink() { |
| 2072 | - return $this->nextLink; |
|
| 2072 | + return $this->nextLink; |
|
| 2073 | 2073 | } |
| 2074 | 2074 | public function setPreviousLink( $previousLink) { |
| 2075 | - $this->previousLink = $previousLink; |
|
| 2075 | + $this->previousLink = $previousLink; |
|
| 2076 | 2076 | } |
| 2077 | 2077 | public function getPreviousLink() { |
| 2078 | - return $this->previousLink; |
|
| 2078 | + return $this->previousLink; |
|
| 2079 | 2079 | } |
| 2080 | 2080 | public function setStartIndex( $startIndex) { |
| 2081 | - $this->startIndex = $startIndex; |
|
| 2081 | + $this->startIndex = $startIndex; |
|
| 2082 | 2082 | } |
| 2083 | 2083 | public function getStartIndex() { |
| 2084 | - return $this->startIndex; |
|
| 2084 | + return $this->startIndex; |
|
| 2085 | 2085 | } |
| 2086 | 2086 | public function setTotalResults( $totalResults) { |
| 2087 | - $this->totalResults = $totalResults; |
|
| 2087 | + $this->totalResults = $totalResults; |
|
| 2088 | 2088 | } |
| 2089 | 2089 | public function getTotalResults() { |
| 2090 | - return $this->totalResults; |
|
| 2090 | + return $this->totalResults; |
|
| 2091 | 2091 | } |
| 2092 | 2092 | } |
| 2093 | 2093 | |
@@ -2124,167 +2124,167 @@ discard block |
||
| 2124 | 2124 | public $winnerConfidenceLevel; |
| 2125 | 2125 | public $winnerFound; |
| 2126 | 2126 | public function setAccountId( $accountId) { |
| 2127 | - $this->accountId = $accountId; |
|
| 2127 | + $this->accountId = $accountId; |
|
| 2128 | 2128 | } |
| 2129 | 2129 | public function getAccountId() { |
| 2130 | - return $this->accountId; |
|
| 2130 | + return $this->accountId; |
|
| 2131 | 2131 | } |
| 2132 | 2132 | public function setCreated( $created) { |
| 2133 | - $this->created = $created; |
|
| 2133 | + $this->created = $created; |
|
| 2134 | 2134 | } |
| 2135 | 2135 | public function getCreated() { |
| 2136 | - return $this->created; |
|
| 2136 | + return $this->created; |
|
| 2137 | 2137 | } |
| 2138 | 2138 | public function setDescription( $description) { |
| 2139 | - $this->description = $description; |
|
| 2139 | + $this->description = $description; |
|
| 2140 | 2140 | } |
| 2141 | 2141 | public function getDescription() { |
| 2142 | - return $this->description; |
|
| 2142 | + return $this->description; |
|
| 2143 | 2143 | } |
| 2144 | 2144 | public function setEditableInGaUi( $editableInGaUi) { |
| 2145 | - $this->editableInGaUi = $editableInGaUi; |
|
| 2145 | + $this->editableInGaUi = $editableInGaUi; |
|
| 2146 | 2146 | } |
| 2147 | 2147 | public function getEditableInGaUi() { |
| 2148 | - return $this->editableInGaUi; |
|
| 2148 | + return $this->editableInGaUi; |
|
| 2149 | 2149 | } |
| 2150 | 2150 | public function setEndTime( $endTime) { |
| 2151 | - $this->endTime = $endTime; |
|
| 2151 | + $this->endTime = $endTime; |
|
| 2152 | 2152 | } |
| 2153 | 2153 | public function getEndTime() { |
| 2154 | - return $this->endTime; |
|
| 2154 | + return $this->endTime; |
|
| 2155 | 2155 | } |
| 2156 | 2156 | public function setId( $id) { |
| 2157 | - $this->id = $id; |
|
| 2157 | + $this->id = $id; |
|
| 2158 | 2158 | } |
| 2159 | 2159 | public function getId() { |
| 2160 | - return $this->id; |
|
| 2160 | + return $this->id; |
|
| 2161 | 2161 | } |
| 2162 | 2162 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 2163 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 2163 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 2164 | 2164 | } |
| 2165 | 2165 | public function getInternalWebPropertyId() { |
| 2166 | - return $this->internalWebPropertyId; |
|
| 2166 | + return $this->internalWebPropertyId; |
|
| 2167 | 2167 | } |
| 2168 | 2168 | public function setKind( $kind) { |
| 2169 | - $this->kind = $kind; |
|
| 2169 | + $this->kind = $kind; |
|
| 2170 | 2170 | } |
| 2171 | 2171 | public function getKind() { |
| 2172 | - return $this->kind; |
|
| 2172 | + return $this->kind; |
|
| 2173 | 2173 | } |
| 2174 | 2174 | public function setMinimumExperimentLengthInDays( $minimumExperimentLengthInDays) { |
| 2175 | - $this->minimumExperimentLengthInDays = $minimumExperimentLengthInDays; |
|
| 2175 | + $this->minimumExperimentLengthInDays = $minimumExperimentLengthInDays; |
|
| 2176 | 2176 | } |
| 2177 | 2177 | public function getMinimumExperimentLengthInDays() { |
| 2178 | - return $this->minimumExperimentLengthInDays; |
|
| 2178 | + return $this->minimumExperimentLengthInDays; |
|
| 2179 | 2179 | } |
| 2180 | 2180 | public function setName( $name) { |
| 2181 | - $this->name = $name; |
|
| 2181 | + $this->name = $name; |
|
| 2182 | 2182 | } |
| 2183 | 2183 | public function getName() { |
| 2184 | - return $this->name; |
|
| 2184 | + return $this->name; |
|
| 2185 | 2185 | } |
| 2186 | 2186 | public function setObjectiveMetric( $objectiveMetric) { |
| 2187 | - $this->objectiveMetric = $objectiveMetric; |
|
| 2187 | + $this->objectiveMetric = $objectiveMetric; |
|
| 2188 | 2188 | } |
| 2189 | 2189 | public function getObjectiveMetric() { |
| 2190 | - return $this->objectiveMetric; |
|
| 2190 | + return $this->objectiveMetric; |
|
| 2191 | 2191 | } |
| 2192 | 2192 | public function setOptimizationType( $optimizationType) { |
| 2193 | - $this->optimizationType = $optimizationType; |
|
| 2193 | + $this->optimizationType = $optimizationType; |
|
| 2194 | 2194 | } |
| 2195 | 2195 | public function getOptimizationType() { |
| 2196 | - return $this->optimizationType; |
|
| 2196 | + return $this->optimizationType; |
|
| 2197 | 2197 | } |
| 2198 | 2198 | public function setParentLink(Google_ExperimentParentLink $parentLink) { |
| 2199 | - $this->parentLink = $parentLink; |
|
| 2199 | + $this->parentLink = $parentLink; |
|
| 2200 | 2200 | } |
| 2201 | 2201 | public function getParentLink() { |
| 2202 | - return $this->parentLink; |
|
| 2202 | + return $this->parentLink; |
|
| 2203 | 2203 | } |
| 2204 | 2204 | public function setProfileId( $profileId) { |
| 2205 | - $this->profileId = $profileId; |
|
| 2205 | + $this->profileId = $profileId; |
|
| 2206 | 2206 | } |
| 2207 | 2207 | public function getProfileId() { |
| 2208 | - return $this->profileId; |
|
| 2208 | + return $this->profileId; |
|
| 2209 | 2209 | } |
| 2210 | 2210 | public function setReasonExperimentEnded( $reasonExperimentEnded) { |
| 2211 | - $this->reasonExperimentEnded = $reasonExperimentEnded; |
|
| 2211 | + $this->reasonExperimentEnded = $reasonExperimentEnded; |
|
| 2212 | 2212 | } |
| 2213 | 2213 | public function getReasonExperimentEnded() { |
| 2214 | - return $this->reasonExperimentEnded; |
|
| 2214 | + return $this->reasonExperimentEnded; |
|
| 2215 | 2215 | } |
| 2216 | 2216 | public function setRewriteVariationUrlsAsOriginal( $rewriteVariationUrlsAsOriginal) { |
| 2217 | - $this->rewriteVariationUrlsAsOriginal = $rewriteVariationUrlsAsOriginal; |
|
| 2217 | + $this->rewriteVariationUrlsAsOriginal = $rewriteVariationUrlsAsOriginal; |
|
| 2218 | 2218 | } |
| 2219 | 2219 | public function getRewriteVariationUrlsAsOriginal() { |
| 2220 | - return $this->rewriteVariationUrlsAsOriginal; |
|
| 2220 | + return $this->rewriteVariationUrlsAsOriginal; |
|
| 2221 | 2221 | } |
| 2222 | 2222 | public function setSelfLink( $selfLink) { |
| 2223 | - $this->selfLink = $selfLink; |
|
| 2223 | + $this->selfLink = $selfLink; |
|
| 2224 | 2224 | } |
| 2225 | 2225 | public function getSelfLink() { |
| 2226 | - return $this->selfLink; |
|
| 2226 | + return $this->selfLink; |
|
| 2227 | 2227 | } |
| 2228 | 2228 | public function setServingFramework( $servingFramework) { |
| 2229 | - $this->servingFramework = $servingFramework; |
|
| 2229 | + $this->servingFramework = $servingFramework; |
|
| 2230 | 2230 | } |
| 2231 | 2231 | public function getServingFramework() { |
| 2232 | - return $this->servingFramework; |
|
| 2232 | + return $this->servingFramework; |
|
| 2233 | 2233 | } |
| 2234 | 2234 | public function setSnippet( $snippet) { |
| 2235 | - $this->snippet = $snippet; |
|
| 2235 | + $this->snippet = $snippet; |
|
| 2236 | 2236 | } |
| 2237 | 2237 | public function getSnippet() { |
| 2238 | - return $this->snippet; |
|
| 2238 | + return $this->snippet; |
|
| 2239 | 2239 | } |
| 2240 | 2240 | public function setStartTime( $startTime) { |
| 2241 | - $this->startTime = $startTime; |
|
| 2241 | + $this->startTime = $startTime; |
|
| 2242 | 2242 | } |
| 2243 | 2243 | public function getStartTime() { |
| 2244 | - return $this->startTime; |
|
| 2244 | + return $this->startTime; |
|
| 2245 | 2245 | } |
| 2246 | 2246 | public function setStatus( $status) { |
| 2247 | - $this->status = $status; |
|
| 2247 | + $this->status = $status; |
|
| 2248 | 2248 | } |
| 2249 | 2249 | public function getStatus() { |
| 2250 | - return $this->status; |
|
| 2250 | + return $this->status; |
|
| 2251 | 2251 | } |
| 2252 | 2252 | public function setTrafficCoverage( $trafficCoverage) { |
| 2253 | - $this->trafficCoverage = $trafficCoverage; |
|
| 2253 | + $this->trafficCoverage = $trafficCoverage; |
|
| 2254 | 2254 | } |
| 2255 | 2255 | public function getTrafficCoverage() { |
| 2256 | - return $this->trafficCoverage; |
|
| 2256 | + return $this->trafficCoverage; |
|
| 2257 | 2257 | } |
| 2258 | 2258 | public function setUpdated( $updated) { |
| 2259 | - $this->updated = $updated; |
|
| 2259 | + $this->updated = $updated; |
|
| 2260 | 2260 | } |
| 2261 | 2261 | public function getUpdated() { |
| 2262 | - return $this->updated; |
|
| 2262 | + return $this->updated; |
|
| 2263 | 2263 | } |
| 2264 | 2264 | public function setVariations(/* array(Google_ExperimentVariations) */ $variations) { |
| 2265 | - $this->assertIsArray($variations, 'Google_ExperimentVariations', __METHOD__); |
|
| 2266 | - $this->variations = $variations; |
|
| 2265 | + $this->assertIsArray($variations, 'Google_ExperimentVariations', __METHOD__); |
|
| 2266 | + $this->variations = $variations; |
|
| 2267 | 2267 | } |
| 2268 | 2268 | public function getVariations() { |
| 2269 | - return $this->variations; |
|
| 2269 | + return $this->variations; |
|
| 2270 | 2270 | } |
| 2271 | 2271 | public function setWebPropertyId( $webPropertyId) { |
| 2272 | - $this->webPropertyId = $webPropertyId; |
|
| 2272 | + $this->webPropertyId = $webPropertyId; |
|
| 2273 | 2273 | } |
| 2274 | 2274 | public function getWebPropertyId() { |
| 2275 | - return $this->webPropertyId; |
|
| 2275 | + return $this->webPropertyId; |
|
| 2276 | 2276 | } |
| 2277 | 2277 | public function setWinnerConfidenceLevel( $winnerConfidenceLevel) { |
| 2278 | - $this->winnerConfidenceLevel = $winnerConfidenceLevel; |
|
| 2278 | + $this->winnerConfidenceLevel = $winnerConfidenceLevel; |
|
| 2279 | 2279 | } |
| 2280 | 2280 | public function getWinnerConfidenceLevel() { |
| 2281 | - return $this->winnerConfidenceLevel; |
|
| 2281 | + return $this->winnerConfidenceLevel; |
|
| 2282 | 2282 | } |
| 2283 | 2283 | public function setWinnerFound( $winnerFound) { |
| 2284 | - $this->winnerFound = $winnerFound; |
|
| 2284 | + $this->winnerFound = $winnerFound; |
|
| 2285 | 2285 | } |
| 2286 | 2286 | public function getWinnerFound() { |
| 2287 | - return $this->winnerFound; |
|
| 2287 | + return $this->winnerFound; |
|
| 2288 | 2288 | } |
| 2289 | 2289 | } |
| 2290 | 2290 | |
@@ -2292,16 +2292,16 @@ discard block |
||
| 2292 | 2292 | public $href; |
| 2293 | 2293 | public $type; |
| 2294 | 2294 | public function setHref( $href) { |
| 2295 | - $this->href = $href; |
|
| 2295 | + $this->href = $href; |
|
| 2296 | 2296 | } |
| 2297 | 2297 | public function getHref() { |
| 2298 | - return $this->href; |
|
| 2298 | + return $this->href; |
|
| 2299 | 2299 | } |
| 2300 | 2300 | public function setType( $type) { |
| 2301 | - $this->type = $type; |
|
| 2301 | + $this->type = $type; |
|
| 2302 | 2302 | } |
| 2303 | 2303 | public function getType() { |
| 2304 | - return $this->type; |
|
| 2304 | + return $this->type; |
|
| 2305 | 2305 | } |
| 2306 | 2306 | } |
| 2307 | 2307 | |
@@ -2312,34 +2312,34 @@ discard block |
||
| 2312 | 2312 | public $weight; |
| 2313 | 2313 | public $won; |
| 2314 | 2314 | public function setName( $name) { |
| 2315 | - $this->name = $name; |
|
| 2315 | + $this->name = $name; |
|
| 2316 | 2316 | } |
| 2317 | 2317 | public function getName() { |
| 2318 | - return $this->name; |
|
| 2318 | + return $this->name; |
|
| 2319 | 2319 | } |
| 2320 | 2320 | public function setStatus( $status) { |
| 2321 | - $this->status = $status; |
|
| 2321 | + $this->status = $status; |
|
| 2322 | 2322 | } |
| 2323 | 2323 | public function getStatus() { |
| 2324 | - return $this->status; |
|
| 2324 | + return $this->status; |
|
| 2325 | 2325 | } |
| 2326 | 2326 | public function setUrl( $url) { |
| 2327 | - $this->url = $url; |
|
| 2327 | + $this->url = $url; |
|
| 2328 | 2328 | } |
| 2329 | 2329 | public function getUrl() { |
| 2330 | - return $this->url; |
|
| 2330 | + return $this->url; |
|
| 2331 | 2331 | } |
| 2332 | 2332 | public function setWeight( $weight) { |
| 2333 | - $this->weight = $weight; |
|
| 2333 | + $this->weight = $weight; |
|
| 2334 | 2334 | } |
| 2335 | 2335 | public function getWeight() { |
| 2336 | - return $this->weight; |
|
| 2336 | + return $this->weight; |
|
| 2337 | 2337 | } |
| 2338 | 2338 | public function setWon( $won) { |
| 2339 | - $this->won = $won; |
|
| 2339 | + $this->won = $won; |
|
| 2340 | 2340 | } |
| 2341 | 2341 | public function getWon() { |
| 2342 | - return $this->won; |
|
| 2342 | + return $this->won; |
|
| 2343 | 2343 | } |
| 2344 | 2344 | } |
| 2345 | 2345 | |
@@ -2355,53 +2355,53 @@ discard block |
||
| 2355 | 2355 | public $totalResults; |
| 2356 | 2356 | public $username; |
| 2357 | 2357 | public function setItems(/* array(Google_Experiment) */ $items) { |
| 2358 | - $this->assertIsArray($items, 'Google_Experiment', __METHOD__); |
|
| 2359 | - $this->items = $items; |
|
| 2358 | + $this->assertIsArray($items, 'Google_Experiment', __METHOD__); |
|
| 2359 | + $this->items = $items; |
|
| 2360 | 2360 | } |
| 2361 | 2361 | public function getItems() { |
| 2362 | - return $this->items; |
|
| 2362 | + return $this->items; |
|
| 2363 | 2363 | } |
| 2364 | 2364 | public function setItemsPerPage( $itemsPerPage) { |
| 2365 | - $this->itemsPerPage = $itemsPerPage; |
|
| 2365 | + $this->itemsPerPage = $itemsPerPage; |
|
| 2366 | 2366 | } |
| 2367 | 2367 | public function getItemsPerPage() { |
| 2368 | - return $this->itemsPerPage; |
|
| 2368 | + return $this->itemsPerPage; |
|
| 2369 | 2369 | } |
| 2370 | 2370 | public function setKind( $kind) { |
| 2371 | - $this->kind = $kind; |
|
| 2371 | + $this->kind = $kind; |
|
| 2372 | 2372 | } |
| 2373 | 2373 | public function getKind() { |
| 2374 | - return $this->kind; |
|
| 2374 | + return $this->kind; |
|
| 2375 | 2375 | } |
| 2376 | 2376 | public function setNextLink( $nextLink) { |
| 2377 | - $this->nextLink = $nextLink; |
|
| 2377 | + $this->nextLink = $nextLink; |
|
| 2378 | 2378 | } |
| 2379 | 2379 | public function getNextLink() { |
| 2380 | - return $this->nextLink; |
|
| 2380 | + return $this->nextLink; |
|
| 2381 | 2381 | } |
| 2382 | 2382 | public function setPreviousLink( $previousLink) { |
| 2383 | - $this->previousLink = $previousLink; |
|
| 2383 | + $this->previousLink = $previousLink; |
|
| 2384 | 2384 | } |
| 2385 | 2385 | public function getPreviousLink() { |
| 2386 | - return $this->previousLink; |
|
| 2386 | + return $this->previousLink; |
|
| 2387 | 2387 | } |
| 2388 | 2388 | public function setStartIndex( $startIndex) { |
| 2389 | - $this->startIndex = $startIndex; |
|
| 2389 | + $this->startIndex = $startIndex; |
|
| 2390 | 2390 | } |
| 2391 | 2391 | public function getStartIndex() { |
| 2392 | - return $this->startIndex; |
|
| 2392 | + return $this->startIndex; |
|
| 2393 | 2393 | } |
| 2394 | 2394 | public function setTotalResults( $totalResults) { |
| 2395 | - $this->totalResults = $totalResults; |
|
| 2395 | + $this->totalResults = $totalResults; |
|
| 2396 | 2396 | } |
| 2397 | 2397 | public function getTotalResults() { |
| 2398 | - return $this->totalResults; |
|
| 2398 | + return $this->totalResults; |
|
| 2399 | 2399 | } |
| 2400 | 2400 | public function setUsername( $username) { |
| 2401 | - $this->username = $username; |
|
| 2401 | + $this->username = $username; |
|
| 2402 | 2402 | } |
| 2403 | 2403 | public function getUsername() { |
| 2404 | - return $this->username; |
|
| 2404 | + return $this->username; |
|
| 2405 | 2405 | } |
| 2406 | 2406 | } |
| 2407 | 2407 | |
@@ -2426,84 +2426,84 @@ discard block |
||
| 2426 | 2426 | public $totalResults; |
| 2427 | 2427 | public $totalsForAllResults; |
| 2428 | 2428 | public function setColumnHeaders(/* array(Google_GaDataColumnHeaders) */ $columnHeaders) { |
| 2429 | - $this->assertIsArray($columnHeaders, 'Google_GaDataColumnHeaders', __METHOD__); |
|
| 2430 | - $this->columnHeaders = $columnHeaders; |
|
| 2429 | + $this->assertIsArray($columnHeaders, 'Google_GaDataColumnHeaders', __METHOD__); |
|
| 2430 | + $this->columnHeaders = $columnHeaders; |
|
| 2431 | 2431 | } |
| 2432 | 2432 | public function getColumnHeaders() { |
| 2433 | - return $this->columnHeaders; |
|
| 2433 | + return $this->columnHeaders; |
|
| 2434 | 2434 | } |
| 2435 | 2435 | public function setContainsSampledData( $containsSampledData) { |
| 2436 | - $this->containsSampledData = $containsSampledData; |
|
| 2436 | + $this->containsSampledData = $containsSampledData; |
|
| 2437 | 2437 | } |
| 2438 | 2438 | public function getContainsSampledData() { |
| 2439 | - return $this->containsSampledData; |
|
| 2439 | + return $this->containsSampledData; |
|
| 2440 | 2440 | } |
| 2441 | 2441 | public function setId( $id) { |
| 2442 | - $this->id = $id; |
|
| 2442 | + $this->id = $id; |
|
| 2443 | 2443 | } |
| 2444 | 2444 | public function getId() { |
| 2445 | - return $this->id; |
|
| 2445 | + return $this->id; |
|
| 2446 | 2446 | } |
| 2447 | 2447 | public function setItemsPerPage( $itemsPerPage) { |
| 2448 | - $this->itemsPerPage = $itemsPerPage; |
|
| 2448 | + $this->itemsPerPage = $itemsPerPage; |
|
| 2449 | 2449 | } |
| 2450 | 2450 | public function getItemsPerPage() { |
| 2451 | - return $this->itemsPerPage; |
|
| 2451 | + return $this->itemsPerPage; |
|
| 2452 | 2452 | } |
| 2453 | 2453 | public function setKind( $kind) { |
| 2454 | - $this->kind = $kind; |
|
| 2454 | + $this->kind = $kind; |
|
| 2455 | 2455 | } |
| 2456 | 2456 | public function getKind() { |
| 2457 | - return $this->kind; |
|
| 2457 | + return $this->kind; |
|
| 2458 | 2458 | } |
| 2459 | 2459 | public function setNextLink( $nextLink) { |
| 2460 | - $this->nextLink = $nextLink; |
|
| 2460 | + $this->nextLink = $nextLink; |
|
| 2461 | 2461 | } |
| 2462 | 2462 | public function getNextLink() { |
| 2463 | - return $this->nextLink; |
|
| 2463 | + return $this->nextLink; |
|
| 2464 | 2464 | } |
| 2465 | 2465 | public function setPreviousLink( $previousLink) { |
| 2466 | - $this->previousLink = $previousLink; |
|
| 2466 | + $this->previousLink = $previousLink; |
|
| 2467 | 2467 | } |
| 2468 | 2468 | public function getPreviousLink() { |
| 2469 | - return $this->previousLink; |
|
| 2469 | + return $this->previousLink; |
|
| 2470 | 2470 | } |
| 2471 | 2471 | public function setProfileInfo(Google_GaDataProfileInfo $profileInfo) { |
| 2472 | - $this->profileInfo = $profileInfo; |
|
| 2472 | + $this->profileInfo = $profileInfo; |
|
| 2473 | 2473 | } |
| 2474 | 2474 | public function getProfileInfo() { |
| 2475 | - return $this->profileInfo; |
|
| 2475 | + return $this->profileInfo; |
|
| 2476 | 2476 | } |
| 2477 | 2477 | public function setQuery(Google_GaDataQuery $query) { |
| 2478 | - $this->query = $query; |
|
| 2478 | + $this->query = $query; |
|
| 2479 | 2479 | } |
| 2480 | 2480 | public function getQuery() { |
| 2481 | - return $this->query; |
|
| 2481 | + return $this->query; |
|
| 2482 | 2482 | } |
| 2483 | 2483 | public function setRows(/* array(Google_string) */ $rows) { |
| 2484 | - $this->assertIsArray($rows, 'Google_string', __METHOD__); |
|
| 2485 | - $this->rows = $rows; |
|
| 2484 | + $this->assertIsArray($rows, 'Google_string', __METHOD__); |
|
| 2485 | + $this->rows = $rows; |
|
| 2486 | 2486 | } |
| 2487 | 2487 | public function getRows() { |
| 2488 | - return $this->rows; |
|
| 2488 | + return $this->rows; |
|
| 2489 | 2489 | } |
| 2490 | 2490 | public function setSelfLink( $selfLink) { |
| 2491 | - $this->selfLink = $selfLink; |
|
| 2491 | + $this->selfLink = $selfLink; |
|
| 2492 | 2492 | } |
| 2493 | 2493 | public function getSelfLink() { |
| 2494 | - return $this->selfLink; |
|
| 2494 | + return $this->selfLink; |
|
| 2495 | 2495 | } |
| 2496 | 2496 | public function setTotalResults( $totalResults) { |
| 2497 | - $this->totalResults = $totalResults; |
|
| 2497 | + $this->totalResults = $totalResults; |
|
| 2498 | 2498 | } |
| 2499 | 2499 | public function getTotalResults() { |
| 2500 | - return $this->totalResults; |
|
| 2500 | + return $this->totalResults; |
|
| 2501 | 2501 | } |
| 2502 | 2502 | public function setTotalsForAllResults( $totalsForAllResults) { |
| 2503 | - $this->totalsForAllResults = $totalsForAllResults; |
|
| 2503 | + $this->totalsForAllResults = $totalsForAllResults; |
|
| 2504 | 2504 | } |
| 2505 | 2505 | public function getTotalsForAllResults() { |
| 2506 | - return $this->totalsForAllResults; |
|
| 2506 | + return $this->totalsForAllResults; |
|
| 2507 | 2507 | } |
| 2508 | 2508 | } |
| 2509 | 2509 | |
@@ -2512,22 +2512,22 @@ discard block |
||
| 2512 | 2512 | public $dataType; |
| 2513 | 2513 | public $name; |
| 2514 | 2514 | public function setColumnType( $columnType) { |
| 2515 | - $this->columnType = $columnType; |
|
| 2515 | + $this->columnType = $columnType; |
|
| 2516 | 2516 | } |
| 2517 | 2517 | public function getColumnType() { |
| 2518 | - return $this->columnType; |
|
| 2518 | + return $this->columnType; |
|
| 2519 | 2519 | } |
| 2520 | 2520 | public function setDataType( $dataType) { |
| 2521 | - $this->dataType = $dataType; |
|
| 2521 | + $this->dataType = $dataType; |
|
| 2522 | 2522 | } |
| 2523 | 2523 | public function getDataType() { |
| 2524 | - return $this->dataType; |
|
| 2524 | + return $this->dataType; |
|
| 2525 | 2525 | } |
| 2526 | 2526 | public function setName( $name) { |
| 2527 | - $this->name = $name; |
|
| 2527 | + $this->name = $name; |
|
| 2528 | 2528 | } |
| 2529 | 2529 | public function getName() { |
| 2530 | - return $this->name; |
|
| 2530 | + return $this->name; |
|
| 2531 | 2531 | } |
| 2532 | 2532 | } |
| 2533 | 2533 | |
@@ -2539,40 +2539,40 @@ discard block |
||
| 2539 | 2539 | public $tableId; |
| 2540 | 2540 | public $webPropertyId; |
| 2541 | 2541 | public function setAccountId( $accountId) { |
| 2542 | - $this->accountId = $accountId; |
|
| 2542 | + $this->accountId = $accountId; |
|
| 2543 | 2543 | } |
| 2544 | 2544 | public function getAccountId() { |
| 2545 | - return $this->accountId; |
|
| 2545 | + return $this->accountId; |
|
| 2546 | 2546 | } |
| 2547 | 2547 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 2548 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 2548 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 2549 | 2549 | } |
| 2550 | 2550 | public function getInternalWebPropertyId() { |
| 2551 | - return $this->internalWebPropertyId; |
|
| 2551 | + return $this->internalWebPropertyId; |
|
| 2552 | 2552 | } |
| 2553 | 2553 | public function setProfileId( $profileId) { |
| 2554 | - $this->profileId = $profileId; |
|
| 2554 | + $this->profileId = $profileId; |
|
| 2555 | 2555 | } |
| 2556 | 2556 | public function getProfileId() { |
| 2557 | - return $this->profileId; |
|
| 2557 | + return $this->profileId; |
|
| 2558 | 2558 | } |
| 2559 | 2559 | public function setProfileName( $profileName) { |
| 2560 | - $this->profileName = $profileName; |
|
| 2560 | + $this->profileName = $profileName; |
|
| 2561 | 2561 | } |
| 2562 | 2562 | public function getProfileName() { |
| 2563 | - return $this->profileName; |
|
| 2563 | + return $this->profileName; |
|
| 2564 | 2564 | } |
| 2565 | 2565 | public function setTableId( $tableId) { |
| 2566 | - $this->tableId = $tableId; |
|
| 2566 | + $this->tableId = $tableId; |
|
| 2567 | 2567 | } |
| 2568 | 2568 | public function getTableId() { |
| 2569 | - return $this->tableId; |
|
| 2569 | + return $this->tableId; |
|
| 2570 | 2570 | } |
| 2571 | 2571 | public function setWebPropertyId( $webPropertyId) { |
| 2572 | - $this->webPropertyId = $webPropertyId; |
|
| 2572 | + $this->webPropertyId = $webPropertyId; |
|
| 2573 | 2573 | } |
| 2574 | 2574 | public function getWebPropertyId() { |
| 2575 | - return $this->webPropertyId; |
|
| 2575 | + return $this->webPropertyId; |
|
| 2576 | 2576 | } |
| 2577 | 2577 | } |
| 2578 | 2578 | |
@@ -2588,66 +2588,66 @@ discard block |
||
| 2588 | 2588 | public $start_date; |
| 2589 | 2589 | public $start_index; |
| 2590 | 2590 | public function setDimensions( $dimensions) { |
| 2591 | - $this->dimensions = $dimensions; |
|
| 2591 | + $this->dimensions = $dimensions; |
|
| 2592 | 2592 | } |
| 2593 | 2593 | public function getDimensions() { |
| 2594 | - return $this->dimensions; |
|
| 2594 | + return $this->dimensions; |
|
| 2595 | 2595 | } |
| 2596 | 2596 | public function setEnd_date( $end_date) { |
| 2597 | - $this->end_date = $end_date; |
|
| 2597 | + $this->end_date = $end_date; |
|
| 2598 | 2598 | } |
| 2599 | 2599 | public function getEnd_date() { |
| 2600 | - return $this->end_date; |
|
| 2600 | + return $this->end_date; |
|
| 2601 | 2601 | } |
| 2602 | 2602 | public function setFilters( $filters) { |
| 2603 | - $this->filters = $filters; |
|
| 2603 | + $this->filters = $filters; |
|
| 2604 | 2604 | } |
| 2605 | 2605 | public function getFilters() { |
| 2606 | - return $this->filters; |
|
| 2606 | + return $this->filters; |
|
| 2607 | 2607 | } |
| 2608 | 2608 | public function setIds( $ids) { |
| 2609 | - $this->ids = $ids; |
|
| 2609 | + $this->ids = $ids; |
|
| 2610 | 2610 | } |
| 2611 | 2611 | public function getIds() { |
| 2612 | - return $this->ids; |
|
| 2612 | + return $this->ids; |
|
| 2613 | 2613 | } |
| 2614 | 2614 | public function setMax_results( $max_results) { |
| 2615 | - $this->max_results = $max_results; |
|
| 2615 | + $this->max_results = $max_results; |
|
| 2616 | 2616 | } |
| 2617 | 2617 | public function getMax_results() { |
| 2618 | - return $this->max_results; |
|
| 2618 | + return $this->max_results; |
|
| 2619 | 2619 | } |
| 2620 | 2620 | public function setMetrics(/* array(Google_string) */ $metrics) { |
| 2621 | - $this->assertIsArray($metrics, 'Google_string', __METHOD__); |
|
| 2622 | - $this->metrics = $metrics; |
|
| 2621 | + $this->assertIsArray($metrics, 'Google_string', __METHOD__); |
|
| 2622 | + $this->metrics = $metrics; |
|
| 2623 | 2623 | } |
| 2624 | 2624 | public function getMetrics() { |
| 2625 | - return $this->metrics; |
|
| 2625 | + return $this->metrics; |
|
| 2626 | 2626 | } |
| 2627 | 2627 | public function setSegment( $segment) { |
| 2628 | - $this->segment = $segment; |
|
| 2628 | + $this->segment = $segment; |
|
| 2629 | 2629 | } |
| 2630 | 2630 | public function getSegment() { |
| 2631 | - return $this->segment; |
|
| 2631 | + return $this->segment; |
|
| 2632 | 2632 | } |
| 2633 | 2633 | public function setSort(/* array(Google_string) */ $sort) { |
| 2634 | - $this->assertIsArray($sort, 'Google_string', __METHOD__); |
|
| 2635 | - $this->sort = $sort; |
|
| 2634 | + $this->assertIsArray($sort, 'Google_string', __METHOD__); |
|
| 2635 | + $this->sort = $sort; |
|
| 2636 | 2636 | } |
| 2637 | 2637 | public function getSort() { |
| 2638 | - return $this->sort; |
|
| 2638 | + return $this->sort; |
|
| 2639 | 2639 | } |
| 2640 | 2640 | public function setStart_date( $start_date) { |
| 2641 | - $this->start_date = $start_date; |
|
| 2641 | + $this->start_date = $start_date; |
|
| 2642 | 2642 | } |
| 2643 | 2643 | public function getStart_date() { |
| 2644 | - return $this->start_date; |
|
| 2644 | + return $this->start_date; |
|
| 2645 | 2645 | } |
| 2646 | 2646 | public function setStart_index( $start_index) { |
| 2647 | - $this->start_index = $start_index; |
|
| 2647 | + $this->start_index = $start_index; |
|
| 2648 | 2648 | } |
| 2649 | 2649 | public function getStart_index() { |
| 2650 | - return $this->start_index; |
|
| 2650 | + return $this->start_index; |
|
| 2651 | 2651 | } |
| 2652 | 2652 | } |
| 2653 | 2653 | |
@@ -2681,112 +2681,112 @@ discard block |
||
| 2681 | 2681 | public $visitTimeOnSiteDetails; |
| 2682 | 2682 | public $webPropertyId; |
| 2683 | 2683 | public function setAccountId( $accountId) { |
| 2684 | - $this->accountId = $accountId; |
|
| 2684 | + $this->accountId = $accountId; |
|
| 2685 | 2685 | } |
| 2686 | 2686 | public function getAccountId() { |
| 2687 | - return $this->accountId; |
|
| 2687 | + return $this->accountId; |
|
| 2688 | 2688 | } |
| 2689 | 2689 | public function setActive( $active) { |
| 2690 | - $this->active = $active; |
|
| 2690 | + $this->active = $active; |
|
| 2691 | 2691 | } |
| 2692 | 2692 | public function getActive() { |
| 2693 | - return $this->active; |
|
| 2693 | + return $this->active; |
|
| 2694 | 2694 | } |
| 2695 | 2695 | public function setCreated( $created) { |
| 2696 | - $this->created = $created; |
|
| 2696 | + $this->created = $created; |
|
| 2697 | 2697 | } |
| 2698 | 2698 | public function getCreated() { |
| 2699 | - return $this->created; |
|
| 2699 | + return $this->created; |
|
| 2700 | 2700 | } |
| 2701 | 2701 | public function setEventDetails(Google_GoalEventDetails $eventDetails) { |
| 2702 | - $this->eventDetails = $eventDetails; |
|
| 2702 | + $this->eventDetails = $eventDetails; |
|
| 2703 | 2703 | } |
| 2704 | 2704 | public function getEventDetails() { |
| 2705 | - return $this->eventDetails; |
|
| 2705 | + return $this->eventDetails; |
|
| 2706 | 2706 | } |
| 2707 | 2707 | public function setId( $id) { |
| 2708 | - $this->id = $id; |
|
| 2708 | + $this->id = $id; |
|
| 2709 | 2709 | } |
| 2710 | 2710 | public function getId() { |
| 2711 | - return $this->id; |
|
| 2711 | + return $this->id; |
|
| 2712 | 2712 | } |
| 2713 | 2713 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 2714 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 2714 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 2715 | 2715 | } |
| 2716 | 2716 | public function getInternalWebPropertyId() { |
| 2717 | - return $this->internalWebPropertyId; |
|
| 2717 | + return $this->internalWebPropertyId; |
|
| 2718 | 2718 | } |
| 2719 | 2719 | public function setKind( $kind) { |
| 2720 | - $this->kind = $kind; |
|
| 2720 | + $this->kind = $kind; |
|
| 2721 | 2721 | } |
| 2722 | 2722 | public function getKind() { |
| 2723 | - return $this->kind; |
|
| 2723 | + return $this->kind; |
|
| 2724 | 2724 | } |
| 2725 | 2725 | public function setName( $name) { |
| 2726 | - $this->name = $name; |
|
| 2726 | + $this->name = $name; |
|
| 2727 | 2727 | } |
| 2728 | 2728 | public function getName() { |
| 2729 | - return $this->name; |
|
| 2729 | + return $this->name; |
|
| 2730 | 2730 | } |
| 2731 | 2731 | public function setParentLink(Google_GoalParentLink $parentLink) { |
| 2732 | - $this->parentLink = $parentLink; |
|
| 2732 | + $this->parentLink = $parentLink; |
|
| 2733 | 2733 | } |
| 2734 | 2734 | public function getParentLink() { |
| 2735 | - return $this->parentLink; |
|
| 2735 | + return $this->parentLink; |
|
| 2736 | 2736 | } |
| 2737 | 2737 | public function setProfileId( $profileId) { |
| 2738 | - $this->profileId = $profileId; |
|
| 2738 | + $this->profileId = $profileId; |
|
| 2739 | 2739 | } |
| 2740 | 2740 | public function getProfileId() { |
| 2741 | - return $this->profileId; |
|
| 2741 | + return $this->profileId; |
|
| 2742 | 2742 | } |
| 2743 | 2743 | public function setSelfLink( $selfLink) { |
| 2744 | - $this->selfLink = $selfLink; |
|
| 2744 | + $this->selfLink = $selfLink; |
|
| 2745 | 2745 | } |
| 2746 | 2746 | public function getSelfLink() { |
| 2747 | - return $this->selfLink; |
|
| 2747 | + return $this->selfLink; |
|
| 2748 | 2748 | } |
| 2749 | 2749 | public function setType( $type) { |
| 2750 | - $this->type = $type; |
|
| 2750 | + $this->type = $type; |
|
| 2751 | 2751 | } |
| 2752 | 2752 | public function getType() { |
| 2753 | - return $this->type; |
|
| 2753 | + return $this->type; |
|
| 2754 | 2754 | } |
| 2755 | 2755 | public function setUpdated( $updated) { |
| 2756 | - $this->updated = $updated; |
|
| 2756 | + $this->updated = $updated; |
|
| 2757 | 2757 | } |
| 2758 | 2758 | public function getUpdated() { |
| 2759 | - return $this->updated; |
|
| 2759 | + return $this->updated; |
|
| 2760 | 2760 | } |
| 2761 | 2761 | public function setUrlDestinationDetails(Google_GoalUrlDestinationDetails $urlDestinationDetails) { |
| 2762 | - $this->urlDestinationDetails = $urlDestinationDetails; |
|
| 2762 | + $this->urlDestinationDetails = $urlDestinationDetails; |
|
| 2763 | 2763 | } |
| 2764 | 2764 | public function getUrlDestinationDetails() { |
| 2765 | - return $this->urlDestinationDetails; |
|
| 2765 | + return $this->urlDestinationDetails; |
|
| 2766 | 2766 | } |
| 2767 | 2767 | public function setValue( $value) { |
| 2768 | - $this->value = $value; |
|
| 2768 | + $this->value = $value; |
|
| 2769 | 2769 | } |
| 2770 | 2770 | public function getValue() { |
| 2771 | - return $this->value; |
|
| 2771 | + return $this->value; |
|
| 2772 | 2772 | } |
| 2773 | 2773 | public function setVisitNumPagesDetails(Google_GoalVisitNumPagesDetails $visitNumPagesDetails) { |
| 2774 | - $this->visitNumPagesDetails = $visitNumPagesDetails; |
|
| 2774 | + $this->visitNumPagesDetails = $visitNumPagesDetails; |
|
| 2775 | 2775 | } |
| 2776 | 2776 | public function getVisitNumPagesDetails() { |
| 2777 | - return $this->visitNumPagesDetails; |
|
| 2777 | + return $this->visitNumPagesDetails; |
|
| 2778 | 2778 | } |
| 2779 | 2779 | public function setVisitTimeOnSiteDetails(Google_GoalVisitTimeOnSiteDetails $visitTimeOnSiteDetails) { |
| 2780 | - $this->visitTimeOnSiteDetails = $visitTimeOnSiteDetails; |
|
| 2780 | + $this->visitTimeOnSiteDetails = $visitTimeOnSiteDetails; |
|
| 2781 | 2781 | } |
| 2782 | 2782 | public function getVisitTimeOnSiteDetails() { |
| 2783 | - return $this->visitTimeOnSiteDetails; |
|
| 2783 | + return $this->visitTimeOnSiteDetails; |
|
| 2784 | 2784 | } |
| 2785 | 2785 | public function setWebPropertyId( $webPropertyId) { |
| 2786 | - $this->webPropertyId = $webPropertyId; |
|
| 2786 | + $this->webPropertyId = $webPropertyId; |
|
| 2787 | 2787 | } |
| 2788 | 2788 | public function getWebPropertyId() { |
| 2789 | - return $this->webPropertyId; |
|
| 2789 | + return $this->webPropertyId; |
|
| 2790 | 2790 | } |
| 2791 | 2791 | } |
| 2792 | 2792 | |
@@ -2796,17 +2796,17 @@ discard block |
||
| 2796 | 2796 | public $eventConditions; |
| 2797 | 2797 | public $useEventValue; |
| 2798 | 2798 | public function setEventConditions(/* array(Google_GoalEventDetailsEventConditions) */ $eventConditions) { |
| 2799 | - $this->assertIsArray($eventConditions, 'Google_GoalEventDetailsEventConditions', __METHOD__); |
|
| 2800 | - $this->eventConditions = $eventConditions; |
|
| 2799 | + $this->assertIsArray($eventConditions, 'Google_GoalEventDetailsEventConditions', __METHOD__); |
|
| 2800 | + $this->eventConditions = $eventConditions; |
|
| 2801 | 2801 | } |
| 2802 | 2802 | public function getEventConditions() { |
| 2803 | - return $this->eventConditions; |
|
| 2803 | + return $this->eventConditions; |
|
| 2804 | 2804 | } |
| 2805 | 2805 | public function setUseEventValue( $useEventValue) { |
| 2806 | - $this->useEventValue = $useEventValue; |
|
| 2806 | + $this->useEventValue = $useEventValue; |
|
| 2807 | 2807 | } |
| 2808 | 2808 | public function getUseEventValue() { |
| 2809 | - return $this->useEventValue; |
|
| 2809 | + return $this->useEventValue; |
|
| 2810 | 2810 | } |
| 2811 | 2811 | } |
| 2812 | 2812 | |
@@ -2817,34 +2817,34 @@ discard block |
||
| 2817 | 2817 | public $matchType; |
| 2818 | 2818 | public $type; |
| 2819 | 2819 | public function setComparisonType( $comparisonType) { |
| 2820 | - $this->comparisonType = $comparisonType; |
|
| 2820 | + $this->comparisonType = $comparisonType; |
|
| 2821 | 2821 | } |
| 2822 | 2822 | public function getComparisonType() { |
| 2823 | - return $this->comparisonType; |
|
| 2823 | + return $this->comparisonType; |
|
| 2824 | 2824 | } |
| 2825 | 2825 | public function setComparisonValue( $comparisonValue) { |
| 2826 | - $this->comparisonValue = $comparisonValue; |
|
| 2826 | + $this->comparisonValue = $comparisonValue; |
|
| 2827 | 2827 | } |
| 2828 | 2828 | public function getComparisonValue() { |
| 2829 | - return $this->comparisonValue; |
|
| 2829 | + return $this->comparisonValue; |
|
| 2830 | 2830 | } |
| 2831 | 2831 | public function setExpression( $expression) { |
| 2832 | - $this->expression = $expression; |
|
| 2832 | + $this->expression = $expression; |
|
| 2833 | 2833 | } |
| 2834 | 2834 | public function getExpression() { |
| 2835 | - return $this->expression; |
|
| 2835 | + return $this->expression; |
|
| 2836 | 2836 | } |
| 2837 | 2837 | public function setMatchType( $matchType) { |
| 2838 | - $this->matchType = $matchType; |
|
| 2838 | + $this->matchType = $matchType; |
|
| 2839 | 2839 | } |
| 2840 | 2840 | public function getMatchType() { |
| 2841 | - return $this->matchType; |
|
| 2841 | + return $this->matchType; |
|
| 2842 | 2842 | } |
| 2843 | 2843 | public function setType( $type) { |
| 2844 | - $this->type = $type; |
|
| 2844 | + $this->type = $type; |
|
| 2845 | 2845 | } |
| 2846 | 2846 | public function getType() { |
| 2847 | - return $this->type; |
|
| 2847 | + return $this->type; |
|
| 2848 | 2848 | } |
| 2849 | 2849 | } |
| 2850 | 2850 | |
@@ -2852,16 +2852,16 @@ discard block |
||
| 2852 | 2852 | public $href; |
| 2853 | 2853 | public $type; |
| 2854 | 2854 | public function setHref( $href) { |
| 2855 | - $this->href = $href; |
|
| 2855 | + $this->href = $href; |
|
| 2856 | 2856 | } |
| 2857 | 2857 | public function getHref() { |
| 2858 | - return $this->href; |
|
| 2858 | + return $this->href; |
|
| 2859 | 2859 | } |
| 2860 | 2860 | public function setType( $type) { |
| 2861 | - $this->type = $type; |
|
| 2861 | + $this->type = $type; |
|
| 2862 | 2862 | } |
| 2863 | 2863 | public function getType() { |
| 2864 | - return $this->type; |
|
| 2864 | + return $this->type; |
|
| 2865 | 2865 | } |
| 2866 | 2866 | } |
| 2867 | 2867 | |
@@ -2874,35 +2874,35 @@ discard block |
||
| 2874 | 2874 | public $steps; |
| 2875 | 2875 | public $url; |
| 2876 | 2876 | public function setCaseSensitive( $caseSensitive) { |
| 2877 | - $this->caseSensitive = $caseSensitive; |
|
| 2877 | + $this->caseSensitive = $caseSensitive; |
|
| 2878 | 2878 | } |
| 2879 | 2879 | public function getCaseSensitive() { |
| 2880 | - return $this->caseSensitive; |
|
| 2880 | + return $this->caseSensitive; |
|
| 2881 | 2881 | } |
| 2882 | 2882 | public function setFirstStepRequired( $firstStepRequired) { |
| 2883 | - $this->firstStepRequired = $firstStepRequired; |
|
| 2883 | + $this->firstStepRequired = $firstStepRequired; |
|
| 2884 | 2884 | } |
| 2885 | 2885 | public function getFirstStepRequired() { |
| 2886 | - return $this->firstStepRequired; |
|
| 2886 | + return $this->firstStepRequired; |
|
| 2887 | 2887 | } |
| 2888 | 2888 | public function setMatchType( $matchType) { |
| 2889 | - $this->matchType = $matchType; |
|
| 2889 | + $this->matchType = $matchType; |
|
| 2890 | 2890 | } |
| 2891 | 2891 | public function getMatchType() { |
| 2892 | - return $this->matchType; |
|
| 2892 | + return $this->matchType; |
|
| 2893 | 2893 | } |
| 2894 | 2894 | public function setSteps(/* array(Google_GoalUrlDestinationDetailsSteps) */ $steps) { |
| 2895 | - $this->assertIsArray($steps, 'Google_GoalUrlDestinationDetailsSteps', __METHOD__); |
|
| 2896 | - $this->steps = $steps; |
|
| 2895 | + $this->assertIsArray($steps, 'Google_GoalUrlDestinationDetailsSteps', __METHOD__); |
|
| 2896 | + $this->steps = $steps; |
|
| 2897 | 2897 | } |
| 2898 | 2898 | public function getSteps() { |
| 2899 | - return $this->steps; |
|
| 2899 | + return $this->steps; |
|
| 2900 | 2900 | } |
| 2901 | 2901 | public function setUrl( $url) { |
| 2902 | - $this->url = $url; |
|
| 2902 | + $this->url = $url; |
|
| 2903 | 2903 | } |
| 2904 | 2904 | public function getUrl() { |
| 2905 | - return $this->url; |
|
| 2905 | + return $this->url; |
|
| 2906 | 2906 | } |
| 2907 | 2907 | } |
| 2908 | 2908 | |
@@ -2911,22 +2911,22 @@ discard block |
||
| 2911 | 2911 | public $number; |
| 2912 | 2912 | public $url; |
| 2913 | 2913 | public function setName( $name) { |
| 2914 | - $this->name = $name; |
|
| 2914 | + $this->name = $name; |
|
| 2915 | 2915 | } |
| 2916 | 2916 | public function getName() { |
| 2917 | - return $this->name; |
|
| 2917 | + return $this->name; |
|
| 2918 | 2918 | } |
| 2919 | 2919 | public function setNumber( $number) { |
| 2920 | - $this->number = $number; |
|
| 2920 | + $this->number = $number; |
|
| 2921 | 2921 | } |
| 2922 | 2922 | public function getNumber() { |
| 2923 | - return $this->number; |
|
| 2923 | + return $this->number; |
|
| 2924 | 2924 | } |
| 2925 | 2925 | public function setUrl( $url) { |
| 2926 | - $this->url = $url; |
|
| 2926 | + $this->url = $url; |
|
| 2927 | 2927 | } |
| 2928 | 2928 | public function getUrl() { |
| 2929 | - return $this->url; |
|
| 2929 | + return $this->url; |
|
| 2930 | 2930 | } |
| 2931 | 2931 | } |
| 2932 | 2932 | |
@@ -2934,16 +2934,16 @@ discard block |
||
| 2934 | 2934 | public $comparisonType; |
| 2935 | 2935 | public $comparisonValue; |
| 2936 | 2936 | public function setComparisonType( $comparisonType) { |
| 2937 | - $this->comparisonType = $comparisonType; |
|
| 2937 | + $this->comparisonType = $comparisonType; |
|
| 2938 | 2938 | } |
| 2939 | 2939 | public function getComparisonType() { |
| 2940 | - return $this->comparisonType; |
|
| 2940 | + return $this->comparisonType; |
|
| 2941 | 2941 | } |
| 2942 | 2942 | public function setComparisonValue( $comparisonValue) { |
| 2943 | - $this->comparisonValue = $comparisonValue; |
|
| 2943 | + $this->comparisonValue = $comparisonValue; |
|
| 2944 | 2944 | } |
| 2945 | 2945 | public function getComparisonValue() { |
| 2946 | - return $this->comparisonValue; |
|
| 2946 | + return $this->comparisonValue; |
|
| 2947 | 2947 | } |
| 2948 | 2948 | } |
| 2949 | 2949 | |
@@ -2951,16 +2951,16 @@ discard block |
||
| 2951 | 2951 | public $comparisonType; |
| 2952 | 2952 | public $comparisonValue; |
| 2953 | 2953 | public function setComparisonType( $comparisonType) { |
| 2954 | - $this->comparisonType = $comparisonType; |
|
| 2954 | + $this->comparisonType = $comparisonType; |
|
| 2955 | 2955 | } |
| 2956 | 2956 | public function getComparisonType() { |
| 2957 | - return $this->comparisonType; |
|
| 2957 | + return $this->comparisonType; |
|
| 2958 | 2958 | } |
| 2959 | 2959 | public function setComparisonValue( $comparisonValue) { |
| 2960 | - $this->comparisonValue = $comparisonValue; |
|
| 2960 | + $this->comparisonValue = $comparisonValue; |
|
| 2961 | 2961 | } |
| 2962 | 2962 | public function getComparisonValue() { |
| 2963 | - return $this->comparisonValue; |
|
| 2963 | + return $this->comparisonValue; |
|
| 2964 | 2964 | } |
| 2965 | 2965 | } |
| 2966 | 2966 | |
@@ -2976,53 +2976,53 @@ discard block |
||
| 2976 | 2976 | public $totalResults; |
| 2977 | 2977 | public $username; |
| 2978 | 2978 | public function setItems(/* array(Google_Goal) */ $items) { |
| 2979 | - $this->assertIsArray($items, 'Google_Goal', __METHOD__); |
|
| 2980 | - $this->items = $items; |
|
| 2979 | + $this->assertIsArray($items, 'Google_Goal', __METHOD__); |
|
| 2980 | + $this->items = $items; |
|
| 2981 | 2981 | } |
| 2982 | 2982 | public function getItems() { |
| 2983 | - return $this->items; |
|
| 2983 | + return $this->items; |
|
| 2984 | 2984 | } |
| 2985 | 2985 | public function setItemsPerPage( $itemsPerPage) { |
| 2986 | - $this->itemsPerPage = $itemsPerPage; |
|
| 2986 | + $this->itemsPerPage = $itemsPerPage; |
|
| 2987 | 2987 | } |
| 2988 | 2988 | public function getItemsPerPage() { |
| 2989 | - return $this->itemsPerPage; |
|
| 2989 | + return $this->itemsPerPage; |
|
| 2990 | 2990 | } |
| 2991 | 2991 | public function setKind( $kind) { |
| 2992 | - $this->kind = $kind; |
|
| 2992 | + $this->kind = $kind; |
|
| 2993 | 2993 | } |
| 2994 | 2994 | public function getKind() { |
| 2995 | - return $this->kind; |
|
| 2995 | + return $this->kind; |
|
| 2996 | 2996 | } |
| 2997 | 2997 | public function setNextLink( $nextLink) { |
| 2998 | - $this->nextLink = $nextLink; |
|
| 2998 | + $this->nextLink = $nextLink; |
|
| 2999 | 2999 | } |
| 3000 | 3000 | public function getNextLink() { |
| 3001 | - return $this->nextLink; |
|
| 3001 | + return $this->nextLink; |
|
| 3002 | 3002 | } |
| 3003 | 3003 | public function setPreviousLink( $previousLink) { |
| 3004 | - $this->previousLink = $previousLink; |
|
| 3004 | + $this->previousLink = $previousLink; |
|
| 3005 | 3005 | } |
| 3006 | 3006 | public function getPreviousLink() { |
| 3007 | - return $this->previousLink; |
|
| 3007 | + return $this->previousLink; |
|
| 3008 | 3008 | } |
| 3009 | 3009 | public function setStartIndex( $startIndex) { |
| 3010 | - $this->startIndex = $startIndex; |
|
| 3010 | + $this->startIndex = $startIndex; |
|
| 3011 | 3011 | } |
| 3012 | 3012 | public function getStartIndex() { |
| 3013 | - return $this->startIndex; |
|
| 3013 | + return $this->startIndex; |
|
| 3014 | 3014 | } |
| 3015 | 3015 | public function setTotalResults( $totalResults) { |
| 3016 | - $this->totalResults = $totalResults; |
|
| 3016 | + $this->totalResults = $totalResults; |
|
| 3017 | 3017 | } |
| 3018 | 3018 | public function getTotalResults() { |
| 3019 | - return $this->totalResults; |
|
| 3019 | + return $this->totalResults; |
|
| 3020 | 3020 | } |
| 3021 | 3021 | public function setUsername( $username) { |
| 3022 | - $this->username = $username; |
|
| 3022 | + $this->username = $username; |
|
| 3023 | 3023 | } |
| 3024 | 3024 | public function getUsername() { |
| 3025 | - return $this->username; |
|
| 3025 | + return $this->username; |
|
| 3026 | 3026 | } |
| 3027 | 3027 | } |
| 3028 | 3028 | |
@@ -3049,84 +3049,84 @@ discard block |
||
| 3049 | 3049 | public $totalResults; |
| 3050 | 3050 | public $totalsForAllResults; |
| 3051 | 3051 | public function setColumnHeaders(/* array(Google_McfDataColumnHeaders) */ $columnHeaders) { |
| 3052 | - $this->assertIsArray($columnHeaders, 'Google_McfDataColumnHeaders', __METHOD__); |
|
| 3053 | - $this->columnHeaders = $columnHeaders; |
|
| 3052 | + $this->assertIsArray($columnHeaders, 'Google_McfDataColumnHeaders', __METHOD__); |
|
| 3053 | + $this->columnHeaders = $columnHeaders; |
|
| 3054 | 3054 | } |
| 3055 | 3055 | public function getColumnHeaders() { |
| 3056 | - return $this->columnHeaders; |
|
| 3056 | + return $this->columnHeaders; |
|
| 3057 | 3057 | } |
| 3058 | 3058 | public function setContainsSampledData( $containsSampledData) { |
| 3059 | - $this->containsSampledData = $containsSampledData; |
|
| 3059 | + $this->containsSampledData = $containsSampledData; |
|
| 3060 | 3060 | } |
| 3061 | 3061 | public function getContainsSampledData() { |
| 3062 | - return $this->containsSampledData; |
|
| 3062 | + return $this->containsSampledData; |
|
| 3063 | 3063 | } |
| 3064 | 3064 | public function setId( $id) { |
| 3065 | - $this->id = $id; |
|
| 3065 | + $this->id = $id; |
|
| 3066 | 3066 | } |
| 3067 | 3067 | public function getId() { |
| 3068 | - return $this->id; |
|
| 3068 | + return $this->id; |
|
| 3069 | 3069 | } |
| 3070 | 3070 | public function setItemsPerPage( $itemsPerPage) { |
| 3071 | - $this->itemsPerPage = $itemsPerPage; |
|
| 3071 | + $this->itemsPerPage = $itemsPerPage; |
|
| 3072 | 3072 | } |
| 3073 | 3073 | public function getItemsPerPage() { |
| 3074 | - return $this->itemsPerPage; |
|
| 3074 | + return $this->itemsPerPage; |
|
| 3075 | 3075 | } |
| 3076 | 3076 | public function setKind( $kind) { |
| 3077 | - $this->kind = $kind; |
|
| 3077 | + $this->kind = $kind; |
|
| 3078 | 3078 | } |
| 3079 | 3079 | public function getKind() { |
| 3080 | - return $this->kind; |
|
| 3080 | + return $this->kind; |
|
| 3081 | 3081 | } |
| 3082 | 3082 | public function setNextLink( $nextLink) { |
| 3083 | - $this->nextLink = $nextLink; |
|
| 3083 | + $this->nextLink = $nextLink; |
|
| 3084 | 3084 | } |
| 3085 | 3085 | public function getNextLink() { |
| 3086 | - return $this->nextLink; |
|
| 3086 | + return $this->nextLink; |
|
| 3087 | 3087 | } |
| 3088 | 3088 | public function setPreviousLink( $previousLink) { |
| 3089 | - $this->previousLink = $previousLink; |
|
| 3089 | + $this->previousLink = $previousLink; |
|
| 3090 | 3090 | } |
| 3091 | 3091 | public function getPreviousLink() { |
| 3092 | - return $this->previousLink; |
|
| 3092 | + return $this->previousLink; |
|
| 3093 | 3093 | } |
| 3094 | 3094 | public function setProfileInfo(Google_McfDataProfileInfo $profileInfo) { |
| 3095 | - $this->profileInfo = $profileInfo; |
|
| 3095 | + $this->profileInfo = $profileInfo; |
|
| 3096 | 3096 | } |
| 3097 | 3097 | public function getProfileInfo() { |
| 3098 | - return $this->profileInfo; |
|
| 3098 | + return $this->profileInfo; |
|
| 3099 | 3099 | } |
| 3100 | 3100 | public function setQuery(Google_McfDataQuery $query) { |
| 3101 | - $this->query = $query; |
|
| 3101 | + $this->query = $query; |
|
| 3102 | 3102 | } |
| 3103 | 3103 | public function getQuery() { |
| 3104 | - return $this->query; |
|
| 3104 | + return $this->query; |
|
| 3105 | 3105 | } |
| 3106 | 3106 | public function setRows(/* array(Google_McfDataRows) */ $rows) { |
| 3107 | - $this->assertIsArray($rows, 'Google_McfDataRows', __METHOD__); |
|
| 3108 | - $this->rows = $rows; |
|
| 3107 | + $this->assertIsArray($rows, 'Google_McfDataRows', __METHOD__); |
|
| 3108 | + $this->rows = $rows; |
|
| 3109 | 3109 | } |
| 3110 | 3110 | public function getRows() { |
| 3111 | - return $this->rows; |
|
| 3111 | + return $this->rows; |
|
| 3112 | 3112 | } |
| 3113 | 3113 | public function setSelfLink( $selfLink) { |
| 3114 | - $this->selfLink = $selfLink; |
|
| 3114 | + $this->selfLink = $selfLink; |
|
| 3115 | 3115 | } |
| 3116 | 3116 | public function getSelfLink() { |
| 3117 | - return $this->selfLink; |
|
| 3117 | + return $this->selfLink; |
|
| 3118 | 3118 | } |
| 3119 | 3119 | public function setTotalResults( $totalResults) { |
| 3120 | - $this->totalResults = $totalResults; |
|
| 3120 | + $this->totalResults = $totalResults; |
|
| 3121 | 3121 | } |
| 3122 | 3122 | public function getTotalResults() { |
| 3123 | - return $this->totalResults; |
|
| 3123 | + return $this->totalResults; |
|
| 3124 | 3124 | } |
| 3125 | 3125 | public function setTotalsForAllResults( $totalsForAllResults) { |
| 3126 | - $this->totalsForAllResults = $totalsForAllResults; |
|
| 3126 | + $this->totalsForAllResults = $totalsForAllResults; |
|
| 3127 | 3127 | } |
| 3128 | 3128 | public function getTotalsForAllResults() { |
| 3129 | - return $this->totalsForAllResults; |
|
| 3129 | + return $this->totalsForAllResults; |
|
| 3130 | 3130 | } |
| 3131 | 3131 | } |
| 3132 | 3132 | |
@@ -3135,22 +3135,22 @@ discard block |
||
| 3135 | 3135 | public $dataType; |
| 3136 | 3136 | public $name; |
| 3137 | 3137 | public function setColumnType( $columnType) { |
| 3138 | - $this->columnType = $columnType; |
|
| 3138 | + $this->columnType = $columnType; |
|
| 3139 | 3139 | } |
| 3140 | 3140 | public function getColumnType() { |
| 3141 | - return $this->columnType; |
|
| 3141 | + return $this->columnType; |
|
| 3142 | 3142 | } |
| 3143 | 3143 | public function setDataType( $dataType) { |
| 3144 | - $this->dataType = $dataType; |
|
| 3144 | + $this->dataType = $dataType; |
|
| 3145 | 3145 | } |
| 3146 | 3146 | public function getDataType() { |
| 3147 | - return $this->dataType; |
|
| 3147 | + return $this->dataType; |
|
| 3148 | 3148 | } |
| 3149 | 3149 | public function setName( $name) { |
| 3150 | - $this->name = $name; |
|
| 3150 | + $this->name = $name; |
|
| 3151 | 3151 | } |
| 3152 | 3152 | public function getName() { |
| 3153 | - return $this->name; |
|
| 3153 | + return $this->name; |
|
| 3154 | 3154 | } |
| 3155 | 3155 | } |
| 3156 | 3156 | |
@@ -3162,40 +3162,40 @@ discard block |
||
| 3162 | 3162 | public $tableId; |
| 3163 | 3163 | public $webPropertyId; |
| 3164 | 3164 | public function setAccountId( $accountId) { |
| 3165 | - $this->accountId = $accountId; |
|
| 3165 | + $this->accountId = $accountId; |
|
| 3166 | 3166 | } |
| 3167 | 3167 | public function getAccountId() { |
| 3168 | - return $this->accountId; |
|
| 3168 | + return $this->accountId; |
|
| 3169 | 3169 | } |
| 3170 | 3170 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 3171 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3171 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3172 | 3172 | } |
| 3173 | 3173 | public function getInternalWebPropertyId() { |
| 3174 | - return $this->internalWebPropertyId; |
|
| 3174 | + return $this->internalWebPropertyId; |
|
| 3175 | 3175 | } |
| 3176 | 3176 | public function setProfileId( $profileId) { |
| 3177 | - $this->profileId = $profileId; |
|
| 3177 | + $this->profileId = $profileId; |
|
| 3178 | 3178 | } |
| 3179 | 3179 | public function getProfileId() { |
| 3180 | - return $this->profileId; |
|
| 3180 | + return $this->profileId; |
|
| 3181 | 3181 | } |
| 3182 | 3182 | public function setProfileName( $profileName) { |
| 3183 | - $this->profileName = $profileName; |
|
| 3183 | + $this->profileName = $profileName; |
|
| 3184 | 3184 | } |
| 3185 | 3185 | public function getProfileName() { |
| 3186 | - return $this->profileName; |
|
| 3186 | + return $this->profileName; |
|
| 3187 | 3187 | } |
| 3188 | 3188 | public function setTableId( $tableId) { |
| 3189 | - $this->tableId = $tableId; |
|
| 3189 | + $this->tableId = $tableId; |
|
| 3190 | 3190 | } |
| 3191 | 3191 | public function getTableId() { |
| 3192 | - return $this->tableId; |
|
| 3192 | + return $this->tableId; |
|
| 3193 | 3193 | } |
| 3194 | 3194 | public function setWebPropertyId( $webPropertyId) { |
| 3195 | - $this->webPropertyId = $webPropertyId; |
|
| 3195 | + $this->webPropertyId = $webPropertyId; |
|
| 3196 | 3196 | } |
| 3197 | 3197 | public function getWebPropertyId() { |
| 3198 | - return $this->webPropertyId; |
|
| 3198 | + return $this->webPropertyId; |
|
| 3199 | 3199 | } |
| 3200 | 3200 | } |
| 3201 | 3201 | |
@@ -3211,66 +3211,66 @@ discard block |
||
| 3211 | 3211 | public $start_date; |
| 3212 | 3212 | public $start_index; |
| 3213 | 3213 | public function setDimensions( $dimensions) { |
| 3214 | - $this->dimensions = $dimensions; |
|
| 3214 | + $this->dimensions = $dimensions; |
|
| 3215 | 3215 | } |
| 3216 | 3216 | public function getDimensions() { |
| 3217 | - return $this->dimensions; |
|
| 3217 | + return $this->dimensions; |
|
| 3218 | 3218 | } |
| 3219 | 3219 | public function setEnd_date( $end_date) { |
| 3220 | - $this->end_date = $end_date; |
|
| 3220 | + $this->end_date = $end_date; |
|
| 3221 | 3221 | } |
| 3222 | 3222 | public function getEnd_date() { |
| 3223 | - return $this->end_date; |
|
| 3223 | + return $this->end_date; |
|
| 3224 | 3224 | } |
| 3225 | 3225 | public function setFilters( $filters) { |
| 3226 | - $this->filters = $filters; |
|
| 3226 | + $this->filters = $filters; |
|
| 3227 | 3227 | } |
| 3228 | 3228 | public function getFilters() { |
| 3229 | - return $this->filters; |
|
| 3229 | + return $this->filters; |
|
| 3230 | 3230 | } |
| 3231 | 3231 | public function setIds( $ids) { |
| 3232 | - $this->ids = $ids; |
|
| 3232 | + $this->ids = $ids; |
|
| 3233 | 3233 | } |
| 3234 | 3234 | public function getIds() { |
| 3235 | - return $this->ids; |
|
| 3235 | + return $this->ids; |
|
| 3236 | 3236 | } |
| 3237 | 3237 | public function setMax_results( $max_results) { |
| 3238 | - $this->max_results = $max_results; |
|
| 3238 | + $this->max_results = $max_results; |
|
| 3239 | 3239 | } |
| 3240 | 3240 | public function getMax_results() { |
| 3241 | - return $this->max_results; |
|
| 3241 | + return $this->max_results; |
|
| 3242 | 3242 | } |
| 3243 | 3243 | public function setMetrics(/* array(Google_string) */ $metrics) { |
| 3244 | - $this->assertIsArray($metrics, 'Google_string', __METHOD__); |
|
| 3245 | - $this->metrics = $metrics; |
|
| 3244 | + $this->assertIsArray($metrics, 'Google_string', __METHOD__); |
|
| 3245 | + $this->metrics = $metrics; |
|
| 3246 | 3246 | } |
| 3247 | 3247 | public function getMetrics() { |
| 3248 | - return $this->metrics; |
|
| 3248 | + return $this->metrics; |
|
| 3249 | 3249 | } |
| 3250 | 3250 | public function setSegment( $segment) { |
| 3251 | - $this->segment = $segment; |
|
| 3251 | + $this->segment = $segment; |
|
| 3252 | 3252 | } |
| 3253 | 3253 | public function getSegment() { |
| 3254 | - return $this->segment; |
|
| 3254 | + return $this->segment; |
|
| 3255 | 3255 | } |
| 3256 | 3256 | public function setSort(/* array(Google_string) */ $sort) { |
| 3257 | - $this->assertIsArray($sort, 'Google_string', __METHOD__); |
|
| 3258 | - $this->sort = $sort; |
|
| 3257 | + $this->assertIsArray($sort, 'Google_string', __METHOD__); |
|
| 3258 | + $this->sort = $sort; |
|
| 3259 | 3259 | } |
| 3260 | 3260 | public function getSort() { |
| 3261 | - return $this->sort; |
|
| 3261 | + return $this->sort; |
|
| 3262 | 3262 | } |
| 3263 | 3263 | public function setStart_date( $start_date) { |
| 3264 | - $this->start_date = $start_date; |
|
| 3264 | + $this->start_date = $start_date; |
|
| 3265 | 3265 | } |
| 3266 | 3266 | public function getStart_date() { |
| 3267 | - return $this->start_date; |
|
| 3267 | + return $this->start_date; |
|
| 3268 | 3268 | } |
| 3269 | 3269 | public function setStart_index( $start_index) { |
| 3270 | - $this->start_index = $start_index; |
|
| 3270 | + $this->start_index = $start_index; |
|
| 3271 | 3271 | } |
| 3272 | 3272 | public function getStart_index() { |
| 3273 | - return $this->start_index; |
|
| 3273 | + return $this->start_index; |
|
| 3274 | 3274 | } |
| 3275 | 3275 | } |
| 3276 | 3276 | |
@@ -3280,17 +3280,17 @@ discard block |
||
| 3280 | 3280 | public $conversionPathValue; |
| 3281 | 3281 | public $primitiveValue; |
| 3282 | 3282 | public function setConversionPathValue(/* array(Google_McfDataRowsConversionPathValue) */ $conversionPathValue) { |
| 3283 | - $this->assertIsArray($conversionPathValue, 'Google_McfDataRowsConversionPathValue', __METHOD__); |
|
| 3284 | - $this->conversionPathValue = $conversionPathValue; |
|
| 3283 | + $this->assertIsArray($conversionPathValue, 'Google_McfDataRowsConversionPathValue', __METHOD__); |
|
| 3284 | + $this->conversionPathValue = $conversionPathValue; |
|
| 3285 | 3285 | } |
| 3286 | 3286 | public function getConversionPathValue() { |
| 3287 | - return $this->conversionPathValue; |
|
| 3287 | + return $this->conversionPathValue; |
|
| 3288 | 3288 | } |
| 3289 | 3289 | public function setPrimitiveValue( $primitiveValue) { |
| 3290 | - $this->primitiveValue = $primitiveValue; |
|
| 3290 | + $this->primitiveValue = $primitiveValue; |
|
| 3291 | 3291 | } |
| 3292 | 3292 | public function getPrimitiveValue() { |
| 3293 | - return $this->primitiveValue; |
|
| 3293 | + return $this->primitiveValue; |
|
| 3294 | 3294 | } |
| 3295 | 3295 | } |
| 3296 | 3296 | |
@@ -3298,16 +3298,16 @@ discard block |
||
| 3298 | 3298 | public $interactionType; |
| 3299 | 3299 | public $nodeValue; |
| 3300 | 3300 | public function setInteractionType( $interactionType) { |
| 3301 | - $this->interactionType = $interactionType; |
|
| 3301 | + $this->interactionType = $interactionType; |
|
| 3302 | 3302 | } |
| 3303 | 3303 | public function getInteractionType() { |
| 3304 | - return $this->interactionType; |
|
| 3304 | + return $this->interactionType; |
|
| 3305 | 3305 | } |
| 3306 | 3306 | public function setNodeValue( $nodeValue) { |
| 3307 | - $this->nodeValue = $nodeValue; |
|
| 3307 | + $this->nodeValue = $nodeValue; |
|
| 3308 | 3308 | } |
| 3309 | 3309 | public function getNodeValue() { |
| 3310 | - return $this->nodeValue; |
|
| 3310 | + return $this->nodeValue; |
|
| 3311 | 3311 | } |
| 3312 | 3312 | } |
| 3313 | 3313 | |
@@ -3340,130 +3340,130 @@ discard block |
||
| 3340 | 3340 | public $webPropertyId; |
| 3341 | 3341 | public $websiteUrl; |
| 3342 | 3342 | public function setAccountId( $accountId) { |
| 3343 | - $this->accountId = $accountId; |
|
| 3343 | + $this->accountId = $accountId; |
|
| 3344 | 3344 | } |
| 3345 | 3345 | public function getAccountId() { |
| 3346 | - return $this->accountId; |
|
| 3346 | + return $this->accountId; |
|
| 3347 | 3347 | } |
| 3348 | 3348 | public function setChildLink(Google_ProfileChildLink $childLink) { |
| 3349 | - $this->childLink = $childLink; |
|
| 3349 | + $this->childLink = $childLink; |
|
| 3350 | 3350 | } |
| 3351 | 3351 | public function getChildLink() { |
| 3352 | - return $this->childLink; |
|
| 3352 | + return $this->childLink; |
|
| 3353 | 3353 | } |
| 3354 | 3354 | public function setCreated( $created) { |
| 3355 | - $this->created = $created; |
|
| 3355 | + $this->created = $created; |
|
| 3356 | 3356 | } |
| 3357 | 3357 | public function getCreated() { |
| 3358 | - return $this->created; |
|
| 3358 | + return $this->created; |
|
| 3359 | 3359 | } |
| 3360 | 3360 | public function setCurrency( $currency) { |
| 3361 | - $this->currency = $currency; |
|
| 3361 | + $this->currency = $currency; |
|
| 3362 | 3362 | } |
| 3363 | 3363 | public function getCurrency() { |
| 3364 | - return $this->currency; |
|
| 3364 | + return $this->currency; |
|
| 3365 | 3365 | } |
| 3366 | 3366 | public function setDefaultPage( $defaultPage) { |
| 3367 | - $this->defaultPage = $defaultPage; |
|
| 3367 | + $this->defaultPage = $defaultPage; |
|
| 3368 | 3368 | } |
| 3369 | 3369 | public function getDefaultPage() { |
| 3370 | - return $this->defaultPage; |
|
| 3370 | + return $this->defaultPage; |
|
| 3371 | 3371 | } |
| 3372 | 3372 | public function setECommerceTracking( $eCommerceTracking) { |
| 3373 | - $this->eCommerceTracking = $eCommerceTracking; |
|
| 3373 | + $this->eCommerceTracking = $eCommerceTracking; |
|
| 3374 | 3374 | } |
| 3375 | 3375 | public function getECommerceTracking() { |
| 3376 | - return $this->eCommerceTracking; |
|
| 3376 | + return $this->eCommerceTracking; |
|
| 3377 | 3377 | } |
| 3378 | 3378 | public function setExcludeQueryParameters( $excludeQueryParameters) { |
| 3379 | - $this->excludeQueryParameters = $excludeQueryParameters; |
|
| 3379 | + $this->excludeQueryParameters = $excludeQueryParameters; |
|
| 3380 | 3380 | } |
| 3381 | 3381 | public function getExcludeQueryParameters() { |
| 3382 | - return $this->excludeQueryParameters; |
|
| 3382 | + return $this->excludeQueryParameters; |
|
| 3383 | 3383 | } |
| 3384 | 3384 | public function setId( $id) { |
| 3385 | - $this->id = $id; |
|
| 3385 | + $this->id = $id; |
|
| 3386 | 3386 | } |
| 3387 | 3387 | public function getId() { |
| 3388 | - return $this->id; |
|
| 3388 | + return $this->id; |
|
| 3389 | 3389 | } |
| 3390 | 3390 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 3391 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3391 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3392 | 3392 | } |
| 3393 | 3393 | public function getInternalWebPropertyId() { |
| 3394 | - return $this->internalWebPropertyId; |
|
| 3394 | + return $this->internalWebPropertyId; |
|
| 3395 | 3395 | } |
| 3396 | 3396 | public function setKind( $kind) { |
| 3397 | - $this->kind = $kind; |
|
| 3397 | + $this->kind = $kind; |
|
| 3398 | 3398 | } |
| 3399 | 3399 | public function getKind() { |
| 3400 | - return $this->kind; |
|
| 3400 | + return $this->kind; |
|
| 3401 | 3401 | } |
| 3402 | 3402 | public function setName( $name) { |
| 3403 | - $this->name = $name; |
|
| 3403 | + $this->name = $name; |
|
| 3404 | 3404 | } |
| 3405 | 3405 | public function getName() { |
| 3406 | - return $this->name; |
|
| 3406 | + return $this->name; |
|
| 3407 | 3407 | } |
| 3408 | 3408 | public function setParentLink(Google_ProfileParentLink $parentLink) { |
| 3409 | - $this->parentLink = $parentLink; |
|
| 3409 | + $this->parentLink = $parentLink; |
|
| 3410 | 3410 | } |
| 3411 | 3411 | public function getParentLink() { |
| 3412 | - return $this->parentLink; |
|
| 3412 | + return $this->parentLink; |
|
| 3413 | 3413 | } |
| 3414 | 3414 | public function setPermissions(Google_ProfilePermissions $permissions) { |
| 3415 | - $this->permissions = $permissions; |
|
| 3415 | + $this->permissions = $permissions; |
|
| 3416 | 3416 | } |
| 3417 | 3417 | public function getPermissions() { |
| 3418 | - return $this->permissions; |
|
| 3418 | + return $this->permissions; |
|
| 3419 | 3419 | } |
| 3420 | 3420 | public function setSelfLink( $selfLink) { |
| 3421 | - $this->selfLink = $selfLink; |
|
| 3421 | + $this->selfLink = $selfLink; |
|
| 3422 | 3422 | } |
| 3423 | 3423 | public function getSelfLink() { |
| 3424 | - return $this->selfLink; |
|
| 3424 | + return $this->selfLink; |
|
| 3425 | 3425 | } |
| 3426 | 3426 | public function setSiteSearchCategoryParameters( $siteSearchCategoryParameters) { |
| 3427 | - $this->siteSearchCategoryParameters = $siteSearchCategoryParameters; |
|
| 3427 | + $this->siteSearchCategoryParameters = $siteSearchCategoryParameters; |
|
| 3428 | 3428 | } |
| 3429 | 3429 | public function getSiteSearchCategoryParameters() { |
| 3430 | - return $this->siteSearchCategoryParameters; |
|
| 3430 | + return $this->siteSearchCategoryParameters; |
|
| 3431 | 3431 | } |
| 3432 | 3432 | public function setSiteSearchQueryParameters( $siteSearchQueryParameters) { |
| 3433 | - $this->siteSearchQueryParameters = $siteSearchQueryParameters; |
|
| 3433 | + $this->siteSearchQueryParameters = $siteSearchQueryParameters; |
|
| 3434 | 3434 | } |
| 3435 | 3435 | public function getSiteSearchQueryParameters() { |
| 3436 | - return $this->siteSearchQueryParameters; |
|
| 3436 | + return $this->siteSearchQueryParameters; |
|
| 3437 | 3437 | } |
| 3438 | 3438 | public function setTimezone( $timezone) { |
| 3439 | - $this->timezone = $timezone; |
|
| 3439 | + $this->timezone = $timezone; |
|
| 3440 | 3440 | } |
| 3441 | 3441 | public function getTimezone() { |
| 3442 | - return $this->timezone; |
|
| 3442 | + return $this->timezone; |
|
| 3443 | 3443 | } |
| 3444 | 3444 | public function setType( $type) { |
| 3445 | - $this->type = $type; |
|
| 3445 | + $this->type = $type; |
|
| 3446 | 3446 | } |
| 3447 | 3447 | public function getType() { |
| 3448 | - return $this->type; |
|
| 3448 | + return $this->type; |
|
| 3449 | 3449 | } |
| 3450 | 3450 | public function setUpdated( $updated) { |
| 3451 | - $this->updated = $updated; |
|
| 3451 | + $this->updated = $updated; |
|
| 3452 | 3452 | } |
| 3453 | 3453 | public function getUpdated() { |
| 3454 | - return $this->updated; |
|
| 3454 | + return $this->updated; |
|
| 3455 | 3455 | } |
| 3456 | 3456 | public function setWebPropertyId( $webPropertyId) { |
| 3457 | - $this->webPropertyId = $webPropertyId; |
|
| 3457 | + $this->webPropertyId = $webPropertyId; |
|
| 3458 | 3458 | } |
| 3459 | 3459 | public function getWebPropertyId() { |
| 3460 | - return $this->webPropertyId; |
|
| 3460 | + return $this->webPropertyId; |
|
| 3461 | 3461 | } |
| 3462 | 3462 | public function setWebsiteUrl( $websiteUrl) { |
| 3463 | - $this->websiteUrl = $websiteUrl; |
|
| 3463 | + $this->websiteUrl = $websiteUrl; |
|
| 3464 | 3464 | } |
| 3465 | 3465 | public function getWebsiteUrl() { |
| 3466 | - return $this->websiteUrl; |
|
| 3466 | + return $this->websiteUrl; |
|
| 3467 | 3467 | } |
| 3468 | 3468 | } |
| 3469 | 3469 | |
@@ -3471,16 +3471,16 @@ discard block |
||
| 3471 | 3471 | public $href; |
| 3472 | 3472 | public $type; |
| 3473 | 3473 | public function setHref( $href) { |
| 3474 | - $this->href = $href; |
|
| 3474 | + $this->href = $href; |
|
| 3475 | 3475 | } |
| 3476 | 3476 | public function getHref() { |
| 3477 | - return $this->href; |
|
| 3477 | + return $this->href; |
|
| 3478 | 3478 | } |
| 3479 | 3479 | public function setType( $type) { |
| 3480 | - $this->type = $type; |
|
| 3480 | + $this->type = $type; |
|
| 3481 | 3481 | } |
| 3482 | 3482 | public function getType() { |
| 3483 | - return $this->type; |
|
| 3483 | + return $this->type; |
|
| 3484 | 3484 | } |
| 3485 | 3485 | } |
| 3486 | 3486 | |
@@ -3488,27 +3488,27 @@ discard block |
||
| 3488 | 3488 | public $href; |
| 3489 | 3489 | public $type; |
| 3490 | 3490 | public function setHref( $href) { |
| 3491 | - $this->href = $href; |
|
| 3491 | + $this->href = $href; |
|
| 3492 | 3492 | } |
| 3493 | 3493 | public function getHref() { |
| 3494 | - return $this->href; |
|
| 3494 | + return $this->href; |
|
| 3495 | 3495 | } |
| 3496 | 3496 | public function setType( $type) { |
| 3497 | - $this->type = $type; |
|
| 3497 | + $this->type = $type; |
|
| 3498 | 3498 | } |
| 3499 | 3499 | public function getType() { |
| 3500 | - return $this->type; |
|
| 3500 | + return $this->type; |
|
| 3501 | 3501 | } |
| 3502 | 3502 | } |
| 3503 | 3503 | |
| 3504 | 3504 | class Google_ProfilePermissions extends Google_Model { |
| 3505 | 3505 | public $effective; |
| 3506 | 3506 | public function setEffective(/* array(Google_string) */ $effective) { |
| 3507 | - $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 3508 | - $this->effective = $effective; |
|
| 3507 | + $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 3508 | + $this->effective = $effective; |
|
| 3509 | 3509 | } |
| 3510 | 3510 | public function getEffective() { |
| 3511 | - return $this->effective; |
|
| 3511 | + return $this->effective; |
|
| 3512 | 3512 | } |
| 3513 | 3513 | } |
| 3514 | 3514 | |
@@ -3521,46 +3521,46 @@ discard block |
||
| 3521 | 3521 | public $name; |
| 3522 | 3522 | public $webPropertyId; |
| 3523 | 3523 | public function setAccountId( $accountId) { |
| 3524 | - $this->accountId = $accountId; |
|
| 3524 | + $this->accountId = $accountId; |
|
| 3525 | 3525 | } |
| 3526 | 3526 | public function getAccountId() { |
| 3527 | - return $this->accountId; |
|
| 3527 | + return $this->accountId; |
|
| 3528 | 3528 | } |
| 3529 | 3529 | public function setHref( $href) { |
| 3530 | - $this->href = $href; |
|
| 3530 | + $this->href = $href; |
|
| 3531 | 3531 | } |
| 3532 | 3532 | public function getHref() { |
| 3533 | - return $this->href; |
|
| 3533 | + return $this->href; |
|
| 3534 | 3534 | } |
| 3535 | 3535 | public function setId( $id) { |
| 3536 | - $this->id = $id; |
|
| 3536 | + $this->id = $id; |
|
| 3537 | 3537 | } |
| 3538 | 3538 | public function getId() { |
| 3539 | - return $this->id; |
|
| 3539 | + return $this->id; |
|
| 3540 | 3540 | } |
| 3541 | 3541 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 3542 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3542 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3543 | 3543 | } |
| 3544 | 3544 | public function getInternalWebPropertyId() { |
| 3545 | - return $this->internalWebPropertyId; |
|
| 3545 | + return $this->internalWebPropertyId; |
|
| 3546 | 3546 | } |
| 3547 | 3547 | public function setKind( $kind) { |
| 3548 | - $this->kind = $kind; |
|
| 3548 | + $this->kind = $kind; |
|
| 3549 | 3549 | } |
| 3550 | 3550 | public function getKind() { |
| 3551 | - return $this->kind; |
|
| 3551 | + return $this->kind; |
|
| 3552 | 3552 | } |
| 3553 | 3553 | public function setName( $name) { |
| 3554 | - $this->name = $name; |
|
| 3554 | + $this->name = $name; |
|
| 3555 | 3555 | } |
| 3556 | 3556 | public function getName() { |
| 3557 | - return $this->name; |
|
| 3557 | + return $this->name; |
|
| 3558 | 3558 | } |
| 3559 | 3559 | public function setWebPropertyId( $webPropertyId) { |
| 3560 | - $this->webPropertyId = $webPropertyId; |
|
| 3560 | + $this->webPropertyId = $webPropertyId; |
|
| 3561 | 3561 | } |
| 3562 | 3562 | public function getWebPropertyId() { |
| 3563 | - return $this->webPropertyId; |
|
| 3563 | + return $this->webPropertyId; |
|
| 3564 | 3564 | } |
| 3565 | 3565 | } |
| 3566 | 3566 | |
@@ -3576,53 +3576,53 @@ discard block |
||
| 3576 | 3576 | public $totalResults; |
| 3577 | 3577 | public $username; |
| 3578 | 3578 | public function setItems(/* array(Google_Profile) */ $items) { |
| 3579 | - $this->assertIsArray($items, 'Google_Profile', __METHOD__); |
|
| 3580 | - $this->items = $items; |
|
| 3579 | + $this->assertIsArray($items, 'Google_Profile', __METHOD__); |
|
| 3580 | + $this->items = $items; |
|
| 3581 | 3581 | } |
| 3582 | 3582 | public function getItems() { |
| 3583 | - return $this->items; |
|
| 3583 | + return $this->items; |
|
| 3584 | 3584 | } |
| 3585 | 3585 | public function setItemsPerPage( $itemsPerPage) { |
| 3586 | - $this->itemsPerPage = $itemsPerPage; |
|
| 3586 | + $this->itemsPerPage = $itemsPerPage; |
|
| 3587 | 3587 | } |
| 3588 | 3588 | public function getItemsPerPage() { |
| 3589 | - return $this->itemsPerPage; |
|
| 3589 | + return $this->itemsPerPage; |
|
| 3590 | 3590 | } |
| 3591 | 3591 | public function setKind( $kind) { |
| 3592 | - $this->kind = $kind; |
|
| 3592 | + $this->kind = $kind; |
|
| 3593 | 3593 | } |
| 3594 | 3594 | public function getKind() { |
| 3595 | - return $this->kind; |
|
| 3595 | + return $this->kind; |
|
| 3596 | 3596 | } |
| 3597 | 3597 | public function setNextLink( $nextLink) { |
| 3598 | - $this->nextLink = $nextLink; |
|
| 3598 | + $this->nextLink = $nextLink; |
|
| 3599 | 3599 | } |
| 3600 | 3600 | public function getNextLink() { |
| 3601 | - return $this->nextLink; |
|
| 3601 | + return $this->nextLink; |
|
| 3602 | 3602 | } |
| 3603 | 3603 | public function setPreviousLink( $previousLink) { |
| 3604 | - $this->previousLink = $previousLink; |
|
| 3604 | + $this->previousLink = $previousLink; |
|
| 3605 | 3605 | } |
| 3606 | 3606 | public function getPreviousLink() { |
| 3607 | - return $this->previousLink; |
|
| 3607 | + return $this->previousLink; |
|
| 3608 | 3608 | } |
| 3609 | 3609 | public function setStartIndex( $startIndex) { |
| 3610 | - $this->startIndex = $startIndex; |
|
| 3610 | + $this->startIndex = $startIndex; |
|
| 3611 | 3611 | } |
| 3612 | 3612 | public function getStartIndex() { |
| 3613 | - return $this->startIndex; |
|
| 3613 | + return $this->startIndex; |
|
| 3614 | 3614 | } |
| 3615 | 3615 | public function setTotalResults( $totalResults) { |
| 3616 | - $this->totalResults = $totalResults; |
|
| 3616 | + $this->totalResults = $totalResults; |
|
| 3617 | 3617 | } |
| 3618 | 3618 | public function getTotalResults() { |
| 3619 | - return $this->totalResults; |
|
| 3619 | + return $this->totalResults; |
|
| 3620 | 3620 | } |
| 3621 | 3621 | public function setUsername( $username) { |
| 3622 | - $this->username = $username; |
|
| 3622 | + $this->username = $username; |
|
| 3623 | 3623 | } |
| 3624 | 3624 | public function getUsername() { |
| 3625 | - return $this->username; |
|
| 3625 | + return $this->username; |
|
| 3626 | 3626 | } |
| 3627 | 3627 | } |
| 3628 | 3628 | |
@@ -3643,60 +3643,60 @@ discard block |
||
| 3643 | 3643 | public $totalResults; |
| 3644 | 3644 | public $totalsForAllResults; |
| 3645 | 3645 | public function setColumnHeaders(/* array(Google_RealtimeDataColumnHeaders) */ $columnHeaders) { |
| 3646 | - $this->assertIsArray($columnHeaders, 'Google_RealtimeDataColumnHeaders', __METHOD__); |
|
| 3647 | - $this->columnHeaders = $columnHeaders; |
|
| 3646 | + $this->assertIsArray($columnHeaders, 'Google_RealtimeDataColumnHeaders', __METHOD__); |
|
| 3647 | + $this->columnHeaders = $columnHeaders; |
|
| 3648 | 3648 | } |
| 3649 | 3649 | public function getColumnHeaders() { |
| 3650 | - return $this->columnHeaders; |
|
| 3650 | + return $this->columnHeaders; |
|
| 3651 | 3651 | } |
| 3652 | 3652 | public function setId( $id) { |
| 3653 | - $this->id = $id; |
|
| 3653 | + $this->id = $id; |
|
| 3654 | 3654 | } |
| 3655 | 3655 | public function getId() { |
| 3656 | - return $this->id; |
|
| 3656 | + return $this->id; |
|
| 3657 | 3657 | } |
| 3658 | 3658 | public function setKind( $kind) { |
| 3659 | - $this->kind = $kind; |
|
| 3659 | + $this->kind = $kind; |
|
| 3660 | 3660 | } |
| 3661 | 3661 | public function getKind() { |
| 3662 | - return $this->kind; |
|
| 3662 | + return $this->kind; |
|
| 3663 | 3663 | } |
| 3664 | 3664 | public function setProfileInfo(Google_RealtimeDataProfileInfo $profileInfo) { |
| 3665 | - $this->profileInfo = $profileInfo; |
|
| 3665 | + $this->profileInfo = $profileInfo; |
|
| 3666 | 3666 | } |
| 3667 | 3667 | public function getProfileInfo() { |
| 3668 | - return $this->profileInfo; |
|
| 3668 | + return $this->profileInfo; |
|
| 3669 | 3669 | } |
| 3670 | 3670 | public function setQuery(Google_RealtimeDataQuery $query) { |
| 3671 | - $this->query = $query; |
|
| 3671 | + $this->query = $query; |
|
| 3672 | 3672 | } |
| 3673 | 3673 | public function getQuery() { |
| 3674 | - return $this->query; |
|
| 3674 | + return $this->query; |
|
| 3675 | 3675 | } |
| 3676 | 3676 | public function setRows(/* array(Google_string) */ $rows) { |
| 3677 | - $this->assertIsArray($rows, 'Google_string', __METHOD__); |
|
| 3678 | - $this->rows = $rows; |
|
| 3677 | + $this->assertIsArray($rows, 'Google_string', __METHOD__); |
|
| 3678 | + $this->rows = $rows; |
|
| 3679 | 3679 | } |
| 3680 | 3680 | public function getRows() { |
| 3681 | - return $this->rows; |
|
| 3681 | + return $this->rows; |
|
| 3682 | 3682 | } |
| 3683 | 3683 | public function setSelfLink( $selfLink) { |
| 3684 | - $this->selfLink = $selfLink; |
|
| 3684 | + $this->selfLink = $selfLink; |
|
| 3685 | 3685 | } |
| 3686 | 3686 | public function getSelfLink() { |
| 3687 | - return $this->selfLink; |
|
| 3687 | + return $this->selfLink; |
|
| 3688 | 3688 | } |
| 3689 | 3689 | public function setTotalResults( $totalResults) { |
| 3690 | - $this->totalResults = $totalResults; |
|
| 3690 | + $this->totalResults = $totalResults; |
|
| 3691 | 3691 | } |
| 3692 | 3692 | public function getTotalResults() { |
| 3693 | - return $this->totalResults; |
|
| 3693 | + return $this->totalResults; |
|
| 3694 | 3694 | } |
| 3695 | 3695 | public function setTotalsForAllResults( $totalsForAllResults) { |
| 3696 | - $this->totalsForAllResults = $totalsForAllResults; |
|
| 3696 | + $this->totalsForAllResults = $totalsForAllResults; |
|
| 3697 | 3697 | } |
| 3698 | 3698 | public function getTotalsForAllResults() { |
| 3699 | - return $this->totalsForAllResults; |
|
| 3699 | + return $this->totalsForAllResults; |
|
| 3700 | 3700 | } |
| 3701 | 3701 | } |
| 3702 | 3702 | |
@@ -3705,22 +3705,22 @@ discard block |
||
| 3705 | 3705 | public $dataType; |
| 3706 | 3706 | public $name; |
| 3707 | 3707 | public function setColumnType( $columnType) { |
| 3708 | - $this->columnType = $columnType; |
|
| 3708 | + $this->columnType = $columnType; |
|
| 3709 | 3709 | } |
| 3710 | 3710 | public function getColumnType() { |
| 3711 | - return $this->columnType; |
|
| 3711 | + return $this->columnType; |
|
| 3712 | 3712 | } |
| 3713 | 3713 | public function setDataType( $dataType) { |
| 3714 | - $this->dataType = $dataType; |
|
| 3714 | + $this->dataType = $dataType; |
|
| 3715 | 3715 | } |
| 3716 | 3716 | public function getDataType() { |
| 3717 | - return $this->dataType; |
|
| 3717 | + return $this->dataType; |
|
| 3718 | 3718 | } |
| 3719 | 3719 | public function setName( $name) { |
| 3720 | - $this->name = $name; |
|
| 3720 | + $this->name = $name; |
|
| 3721 | 3721 | } |
| 3722 | 3722 | public function getName() { |
| 3723 | - return $this->name; |
|
| 3723 | + return $this->name; |
|
| 3724 | 3724 | } |
| 3725 | 3725 | } |
| 3726 | 3726 | |
@@ -3732,40 +3732,40 @@ discard block |
||
| 3732 | 3732 | public $tableId; |
| 3733 | 3733 | public $webPropertyId; |
| 3734 | 3734 | public function setAccountId( $accountId) { |
| 3735 | - $this->accountId = $accountId; |
|
| 3735 | + $this->accountId = $accountId; |
|
| 3736 | 3736 | } |
| 3737 | 3737 | public function getAccountId() { |
| 3738 | - return $this->accountId; |
|
| 3738 | + return $this->accountId; |
|
| 3739 | 3739 | } |
| 3740 | 3740 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 3741 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3741 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 3742 | 3742 | } |
| 3743 | 3743 | public function getInternalWebPropertyId() { |
| 3744 | - return $this->internalWebPropertyId; |
|
| 3744 | + return $this->internalWebPropertyId; |
|
| 3745 | 3745 | } |
| 3746 | 3746 | public function setProfileId( $profileId) { |
| 3747 | - $this->profileId = $profileId; |
|
| 3747 | + $this->profileId = $profileId; |
|
| 3748 | 3748 | } |
| 3749 | 3749 | public function getProfileId() { |
| 3750 | - return $this->profileId; |
|
| 3750 | + return $this->profileId; |
|
| 3751 | 3751 | } |
| 3752 | 3752 | public function setProfileName( $profileName) { |
| 3753 | - $this->profileName = $profileName; |
|
| 3753 | + $this->profileName = $profileName; |
|
| 3754 | 3754 | } |
| 3755 | 3755 | public function getProfileName() { |
| 3756 | - return $this->profileName; |
|
| 3756 | + return $this->profileName; |
|
| 3757 | 3757 | } |
| 3758 | 3758 | public function setTableId( $tableId) { |
| 3759 | - $this->tableId = $tableId; |
|
| 3759 | + $this->tableId = $tableId; |
|
| 3760 | 3760 | } |
| 3761 | 3761 | public function getTableId() { |
| 3762 | - return $this->tableId; |
|
| 3762 | + return $this->tableId; |
|
| 3763 | 3763 | } |
| 3764 | 3764 | public function setWebPropertyId( $webPropertyId) { |
| 3765 | - $this->webPropertyId = $webPropertyId; |
|
| 3765 | + $this->webPropertyId = $webPropertyId; |
|
| 3766 | 3766 | } |
| 3767 | 3767 | public function getWebPropertyId() { |
| 3768 | - return $this->webPropertyId; |
|
| 3768 | + return $this->webPropertyId; |
|
| 3769 | 3769 | } |
| 3770 | 3770 | } |
| 3771 | 3771 | |
@@ -3777,42 +3777,42 @@ discard block |
||
| 3777 | 3777 | public $metrics; |
| 3778 | 3778 | public $sort; |
| 3779 | 3779 | public function setDimensions( $dimensions) { |
| 3780 | - $this->dimensions = $dimensions; |
|
| 3780 | + $this->dimensions = $dimensions; |
|
| 3781 | 3781 | } |
| 3782 | 3782 | public function getDimensions() { |
| 3783 | - return $this->dimensions; |
|
| 3783 | + return $this->dimensions; |
|
| 3784 | 3784 | } |
| 3785 | 3785 | public function setFilters( $filters) { |
| 3786 | - $this->filters = $filters; |
|
| 3786 | + $this->filters = $filters; |
|
| 3787 | 3787 | } |
| 3788 | 3788 | public function getFilters() { |
| 3789 | - return $this->filters; |
|
| 3789 | + return $this->filters; |
|
| 3790 | 3790 | } |
| 3791 | 3791 | public function setIds( $ids) { |
| 3792 | - $this->ids = $ids; |
|
| 3792 | + $this->ids = $ids; |
|
| 3793 | 3793 | } |
| 3794 | 3794 | public function getIds() { |
| 3795 | - return $this->ids; |
|
| 3795 | + return $this->ids; |
|
| 3796 | 3796 | } |
| 3797 | 3797 | public function setMax_results( $max_results) { |
| 3798 | - $this->max_results = $max_results; |
|
| 3798 | + $this->max_results = $max_results; |
|
| 3799 | 3799 | } |
| 3800 | 3800 | public function getMax_results() { |
| 3801 | - return $this->max_results; |
|
| 3801 | + return $this->max_results; |
|
| 3802 | 3802 | } |
| 3803 | 3803 | public function setMetrics(/* array(Google_string) */ $metrics) { |
| 3804 | - $this->assertIsArray($metrics, 'Google_string', __METHOD__); |
|
| 3805 | - $this->metrics = $metrics; |
|
| 3804 | + $this->assertIsArray($metrics, 'Google_string', __METHOD__); |
|
| 3805 | + $this->metrics = $metrics; |
|
| 3806 | 3806 | } |
| 3807 | 3807 | public function getMetrics() { |
| 3808 | - return $this->metrics; |
|
| 3808 | + return $this->metrics; |
|
| 3809 | 3809 | } |
| 3810 | 3810 | public function setSort(/* array(Google_string) */ $sort) { |
| 3811 | - $this->assertIsArray($sort, 'Google_string', __METHOD__); |
|
| 3812 | - $this->sort = $sort; |
|
| 3811 | + $this->assertIsArray($sort, 'Google_string', __METHOD__); |
|
| 3812 | + $this->sort = $sort; |
|
| 3813 | 3813 | } |
| 3814 | 3814 | public function getSort() { |
| 3815 | - return $this->sort; |
|
| 3815 | + return $this->sort; |
|
| 3816 | 3816 | } |
| 3817 | 3817 | } |
| 3818 | 3818 | |
@@ -3826,52 +3826,52 @@ discard block |
||
| 3826 | 3826 | public $selfLink; |
| 3827 | 3827 | public $updated; |
| 3828 | 3828 | public function setCreated( $created) { |
| 3829 | - $this->created = $created; |
|
| 3829 | + $this->created = $created; |
|
| 3830 | 3830 | } |
| 3831 | 3831 | public function getCreated() { |
| 3832 | - return $this->created; |
|
| 3832 | + return $this->created; |
|
| 3833 | 3833 | } |
| 3834 | 3834 | public function setDefinition( $definition) { |
| 3835 | - $this->definition = $definition; |
|
| 3835 | + $this->definition = $definition; |
|
| 3836 | 3836 | } |
| 3837 | 3837 | public function getDefinition() { |
| 3838 | - return $this->definition; |
|
| 3838 | + return $this->definition; |
|
| 3839 | 3839 | } |
| 3840 | 3840 | public function setId( $id) { |
| 3841 | - $this->id = $id; |
|
| 3841 | + $this->id = $id; |
|
| 3842 | 3842 | } |
| 3843 | 3843 | public function getId() { |
| 3844 | - return $this->id; |
|
| 3844 | + return $this->id; |
|
| 3845 | 3845 | } |
| 3846 | 3846 | public function setKind( $kind) { |
| 3847 | - $this->kind = $kind; |
|
| 3847 | + $this->kind = $kind; |
|
| 3848 | 3848 | } |
| 3849 | 3849 | public function getKind() { |
| 3850 | - return $this->kind; |
|
| 3850 | + return $this->kind; |
|
| 3851 | 3851 | } |
| 3852 | 3852 | public function setName( $name) { |
| 3853 | - $this->name = $name; |
|
| 3853 | + $this->name = $name; |
|
| 3854 | 3854 | } |
| 3855 | 3855 | public function getName() { |
| 3856 | - return $this->name; |
|
| 3856 | + return $this->name; |
|
| 3857 | 3857 | } |
| 3858 | 3858 | public function setSegmentId( $segmentId) { |
| 3859 | - $this->segmentId = $segmentId; |
|
| 3859 | + $this->segmentId = $segmentId; |
|
| 3860 | 3860 | } |
| 3861 | 3861 | public function getSegmentId() { |
| 3862 | - return $this->segmentId; |
|
| 3862 | + return $this->segmentId; |
|
| 3863 | 3863 | } |
| 3864 | 3864 | public function setSelfLink( $selfLink) { |
| 3865 | - $this->selfLink = $selfLink; |
|
| 3865 | + $this->selfLink = $selfLink; |
|
| 3866 | 3866 | } |
| 3867 | 3867 | public function getSelfLink() { |
| 3868 | - return $this->selfLink; |
|
| 3868 | + return $this->selfLink; |
|
| 3869 | 3869 | } |
| 3870 | 3870 | public function setUpdated( $updated) { |
| 3871 | - $this->updated = $updated; |
|
| 3871 | + $this->updated = $updated; |
|
| 3872 | 3872 | } |
| 3873 | 3873 | public function getUpdated() { |
| 3874 | - return $this->updated; |
|
| 3874 | + return $this->updated; |
|
| 3875 | 3875 | } |
| 3876 | 3876 | } |
| 3877 | 3877 | |
@@ -3887,53 +3887,53 @@ discard block |
||
| 3887 | 3887 | public $totalResults; |
| 3888 | 3888 | public $username; |
| 3889 | 3889 | public function setItems(/* array(Google_Segment) */ $items) { |
| 3890 | - $this->assertIsArray($items, 'Google_Segment', __METHOD__); |
|
| 3891 | - $this->items = $items; |
|
| 3890 | + $this->assertIsArray($items, 'Google_Segment', __METHOD__); |
|
| 3891 | + $this->items = $items; |
|
| 3892 | 3892 | } |
| 3893 | 3893 | public function getItems() { |
| 3894 | - return $this->items; |
|
| 3894 | + return $this->items; |
|
| 3895 | 3895 | } |
| 3896 | 3896 | public function setItemsPerPage( $itemsPerPage) { |
| 3897 | - $this->itemsPerPage = $itemsPerPage; |
|
| 3897 | + $this->itemsPerPage = $itemsPerPage; |
|
| 3898 | 3898 | } |
| 3899 | 3899 | public function getItemsPerPage() { |
| 3900 | - return $this->itemsPerPage; |
|
| 3900 | + return $this->itemsPerPage; |
|
| 3901 | 3901 | } |
| 3902 | 3902 | public function setKind( $kind) { |
| 3903 | - $this->kind = $kind; |
|
| 3903 | + $this->kind = $kind; |
|
| 3904 | 3904 | } |
| 3905 | 3905 | public function getKind() { |
| 3906 | - return $this->kind; |
|
| 3906 | + return $this->kind; |
|
| 3907 | 3907 | } |
| 3908 | 3908 | public function setNextLink( $nextLink) { |
| 3909 | - $this->nextLink = $nextLink; |
|
| 3909 | + $this->nextLink = $nextLink; |
|
| 3910 | 3910 | } |
| 3911 | 3911 | public function getNextLink() { |
| 3912 | - return $this->nextLink; |
|
| 3912 | + return $this->nextLink; |
|
| 3913 | 3913 | } |
| 3914 | 3914 | public function setPreviousLink( $previousLink) { |
| 3915 | - $this->previousLink = $previousLink; |
|
| 3915 | + $this->previousLink = $previousLink; |
|
| 3916 | 3916 | } |
| 3917 | 3917 | public function getPreviousLink() { |
| 3918 | - return $this->previousLink; |
|
| 3918 | + return $this->previousLink; |
|
| 3919 | 3919 | } |
| 3920 | 3920 | public function setStartIndex( $startIndex) { |
| 3921 | - $this->startIndex = $startIndex; |
|
| 3921 | + $this->startIndex = $startIndex; |
|
| 3922 | 3922 | } |
| 3923 | 3923 | public function getStartIndex() { |
| 3924 | - return $this->startIndex; |
|
| 3924 | + return $this->startIndex; |
|
| 3925 | 3925 | } |
| 3926 | 3926 | public function setTotalResults( $totalResults) { |
| 3927 | - $this->totalResults = $totalResults; |
|
| 3927 | + $this->totalResults = $totalResults; |
|
| 3928 | 3928 | } |
| 3929 | 3929 | public function getTotalResults() { |
| 3930 | - return $this->totalResults; |
|
| 3930 | + return $this->totalResults; |
|
| 3931 | 3931 | } |
| 3932 | 3932 | public function setUsername( $username) { |
| 3933 | - $this->username = $username; |
|
| 3933 | + $this->username = $username; |
|
| 3934 | 3934 | } |
| 3935 | 3935 | public function getUsername() { |
| 3936 | - return $this->username; |
|
| 3936 | + return $this->username; |
|
| 3937 | 3937 | } |
| 3938 | 3938 | } |
| 3939 | 3939 | |
@@ -3945,41 +3945,41 @@ discard block |
||
| 3945 | 3945 | public $kind; |
| 3946 | 3946 | public $status; |
| 3947 | 3947 | public function setAccountId( $accountId) { |
| 3948 | - $this->accountId = $accountId; |
|
| 3948 | + $this->accountId = $accountId; |
|
| 3949 | 3949 | } |
| 3950 | 3950 | public function getAccountId() { |
| 3951 | - return $this->accountId; |
|
| 3951 | + return $this->accountId; |
|
| 3952 | 3952 | } |
| 3953 | 3953 | public function setCustomDataSourceId( $customDataSourceId) { |
| 3954 | - $this->customDataSourceId = $customDataSourceId; |
|
| 3954 | + $this->customDataSourceId = $customDataSourceId; |
|
| 3955 | 3955 | } |
| 3956 | 3956 | public function getCustomDataSourceId() { |
| 3957 | - return $this->customDataSourceId; |
|
| 3957 | + return $this->customDataSourceId; |
|
| 3958 | 3958 | } |
| 3959 | 3959 | public function setErrors(/* array(Google_string) */ $errors) { |
| 3960 | - $this->assertIsArray($errors, 'Google_string', __METHOD__); |
|
| 3961 | - $this->errors = $errors; |
|
| 3960 | + $this->assertIsArray($errors, 'Google_string', __METHOD__); |
|
| 3961 | + $this->errors = $errors; |
|
| 3962 | 3962 | } |
| 3963 | 3963 | public function getErrors() { |
| 3964 | - return $this->errors; |
|
| 3964 | + return $this->errors; |
|
| 3965 | 3965 | } |
| 3966 | 3966 | public function setId( $id) { |
| 3967 | - $this->id = $id; |
|
| 3967 | + $this->id = $id; |
|
| 3968 | 3968 | } |
| 3969 | 3969 | public function getId() { |
| 3970 | - return $this->id; |
|
| 3970 | + return $this->id; |
|
| 3971 | 3971 | } |
| 3972 | 3972 | public function setKind( $kind) { |
| 3973 | - $this->kind = $kind; |
|
| 3973 | + $this->kind = $kind; |
|
| 3974 | 3974 | } |
| 3975 | 3975 | public function getKind() { |
| 3976 | - return $this->kind; |
|
| 3976 | + return $this->kind; |
|
| 3977 | 3977 | } |
| 3978 | 3978 | public function setStatus( $status) { |
| 3979 | - $this->status = $status; |
|
| 3979 | + $this->status = $status; |
|
| 3980 | 3980 | } |
| 3981 | 3981 | public function getStatus() { |
| 3982 | - return $this->status; |
|
| 3982 | + return $this->status; |
|
| 3983 | 3983 | } |
| 3984 | 3984 | } |
| 3985 | 3985 | |
@@ -3994,47 +3994,47 @@ discard block |
||
| 3994 | 3994 | public $startIndex; |
| 3995 | 3995 | public $totalResults; |
| 3996 | 3996 | public function setItems(/* array(Google_Upload) */ $items) { |
| 3997 | - $this->assertIsArray($items, 'Google_Upload', __METHOD__); |
|
| 3998 | - $this->items = $items; |
|
| 3997 | + $this->assertIsArray($items, 'Google_Upload', __METHOD__); |
|
| 3998 | + $this->items = $items; |
|
| 3999 | 3999 | } |
| 4000 | 4000 | public function getItems() { |
| 4001 | - return $this->items; |
|
| 4001 | + return $this->items; |
|
| 4002 | 4002 | } |
| 4003 | 4003 | public function setItemsPerPage( $itemsPerPage) { |
| 4004 | - $this->itemsPerPage = $itemsPerPage; |
|
| 4004 | + $this->itemsPerPage = $itemsPerPage; |
|
| 4005 | 4005 | } |
| 4006 | 4006 | public function getItemsPerPage() { |
| 4007 | - return $this->itemsPerPage; |
|
| 4007 | + return $this->itemsPerPage; |
|
| 4008 | 4008 | } |
| 4009 | 4009 | public function setKind( $kind) { |
| 4010 | - $this->kind = $kind; |
|
| 4010 | + $this->kind = $kind; |
|
| 4011 | 4011 | } |
| 4012 | 4012 | public function getKind() { |
| 4013 | - return $this->kind; |
|
| 4013 | + return $this->kind; |
|
| 4014 | 4014 | } |
| 4015 | 4015 | public function setNextLink( $nextLink) { |
| 4016 | - $this->nextLink = $nextLink; |
|
| 4016 | + $this->nextLink = $nextLink; |
|
| 4017 | 4017 | } |
| 4018 | 4018 | public function getNextLink() { |
| 4019 | - return $this->nextLink; |
|
| 4019 | + return $this->nextLink; |
|
| 4020 | 4020 | } |
| 4021 | 4021 | public function setPreviousLink( $previousLink) { |
| 4022 | - $this->previousLink = $previousLink; |
|
| 4022 | + $this->previousLink = $previousLink; |
|
| 4023 | 4023 | } |
| 4024 | 4024 | public function getPreviousLink() { |
| 4025 | - return $this->previousLink; |
|
| 4025 | + return $this->previousLink; |
|
| 4026 | 4026 | } |
| 4027 | 4027 | public function setStartIndex( $startIndex) { |
| 4028 | - $this->startIndex = $startIndex; |
|
| 4028 | + $this->startIndex = $startIndex; |
|
| 4029 | 4029 | } |
| 4030 | 4030 | public function getStartIndex() { |
| 4031 | - return $this->startIndex; |
|
| 4031 | + return $this->startIndex; |
|
| 4032 | 4032 | } |
| 4033 | 4033 | public function setTotalResults( $totalResults) { |
| 4034 | - $this->totalResults = $totalResults; |
|
| 4034 | + $this->totalResults = $totalResults; |
|
| 4035 | 4035 | } |
| 4036 | 4036 | public function getTotalResults() { |
| 4037 | - return $this->totalResults; |
|
| 4037 | + return $this->totalResults; |
|
| 4038 | 4038 | } |
| 4039 | 4039 | } |
| 4040 | 4040 | |
@@ -4043,22 +4043,22 @@ discard block |
||
| 4043 | 4043 | public $id; |
| 4044 | 4044 | public $kind; |
| 4045 | 4045 | public function setEmail( $email) { |
| 4046 | - $this->email = $email; |
|
| 4046 | + $this->email = $email; |
|
| 4047 | 4047 | } |
| 4048 | 4048 | public function getEmail() { |
| 4049 | - return $this->email; |
|
| 4049 | + return $this->email; |
|
| 4050 | 4050 | } |
| 4051 | 4051 | public function setId( $id) { |
| 4052 | - $this->id = $id; |
|
| 4052 | + $this->id = $id; |
|
| 4053 | 4053 | } |
| 4054 | 4054 | public function getId() { |
| 4055 | - return $this->id; |
|
| 4055 | + return $this->id; |
|
| 4056 | 4056 | } |
| 4057 | 4057 | public function setKind( $kind) { |
| 4058 | - $this->kind = $kind; |
|
| 4058 | + $this->kind = $kind; |
|
| 4059 | 4059 | } |
| 4060 | 4060 | public function getKind() { |
| 4061 | - return $this->kind; |
|
| 4061 | + return $this->kind; |
|
| 4062 | 4062 | } |
| 4063 | 4063 | } |
| 4064 | 4064 | |
@@ -4070,40 +4070,40 @@ discard block |
||
| 4070 | 4070 | public $kind; |
| 4071 | 4071 | public $name; |
| 4072 | 4072 | public function setAccountId( $accountId) { |
| 4073 | - $this->accountId = $accountId; |
|
| 4073 | + $this->accountId = $accountId; |
|
| 4074 | 4074 | } |
| 4075 | 4075 | public function getAccountId() { |
| 4076 | - return $this->accountId; |
|
| 4076 | + return $this->accountId; |
|
| 4077 | 4077 | } |
| 4078 | 4078 | public function setHref( $href) { |
| 4079 | - $this->href = $href; |
|
| 4079 | + $this->href = $href; |
|
| 4080 | 4080 | } |
| 4081 | 4081 | public function getHref() { |
| 4082 | - return $this->href; |
|
| 4082 | + return $this->href; |
|
| 4083 | 4083 | } |
| 4084 | 4084 | public function setId( $id) { |
| 4085 | - $this->id = $id; |
|
| 4085 | + $this->id = $id; |
|
| 4086 | 4086 | } |
| 4087 | 4087 | public function getId() { |
| 4088 | - return $this->id; |
|
| 4088 | + return $this->id; |
|
| 4089 | 4089 | } |
| 4090 | 4090 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 4091 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 4091 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 4092 | 4092 | } |
| 4093 | 4093 | public function getInternalWebPropertyId() { |
| 4094 | - return $this->internalWebPropertyId; |
|
| 4094 | + return $this->internalWebPropertyId; |
|
| 4095 | 4095 | } |
| 4096 | 4096 | public function setKind( $kind) { |
| 4097 | - $this->kind = $kind; |
|
| 4097 | + $this->kind = $kind; |
|
| 4098 | 4098 | } |
| 4099 | 4099 | public function getKind() { |
| 4100 | - return $this->kind; |
|
| 4100 | + return $this->kind; |
|
| 4101 | 4101 | } |
| 4102 | 4102 | public function setName( $name) { |
| 4103 | - $this->name = $name; |
|
| 4103 | + $this->name = $name; |
|
| 4104 | 4104 | } |
| 4105 | 4105 | public function getName() { |
| 4106 | - return $this->name; |
|
| 4106 | + return $this->name; |
|
| 4107 | 4107 | } |
| 4108 | 4108 | } |
| 4109 | 4109 | |
@@ -4119,53 +4119,53 @@ discard block |
||
| 4119 | 4119 | public $totalResults; |
| 4120 | 4120 | public $username; |
| 4121 | 4121 | public function setItems(/* array(Google_Webproperty) */ $items) { |
| 4122 | - $this->assertIsArray($items, 'Google_Webproperty', __METHOD__); |
|
| 4123 | - $this->items = $items; |
|
| 4122 | + $this->assertIsArray($items, 'Google_Webproperty', __METHOD__); |
|
| 4123 | + $this->items = $items; |
|
| 4124 | 4124 | } |
| 4125 | 4125 | public function getItems() { |
| 4126 | - return $this->items; |
|
| 4126 | + return $this->items; |
|
| 4127 | 4127 | } |
| 4128 | 4128 | public function setItemsPerPage( $itemsPerPage) { |
| 4129 | - $this->itemsPerPage = $itemsPerPage; |
|
| 4129 | + $this->itemsPerPage = $itemsPerPage; |
|
| 4130 | 4130 | } |
| 4131 | 4131 | public function getItemsPerPage() { |
| 4132 | - return $this->itemsPerPage; |
|
| 4132 | + return $this->itemsPerPage; |
|
| 4133 | 4133 | } |
| 4134 | 4134 | public function setKind( $kind) { |
| 4135 | - $this->kind = $kind; |
|
| 4135 | + $this->kind = $kind; |
|
| 4136 | 4136 | } |
| 4137 | 4137 | public function getKind() { |
| 4138 | - return $this->kind; |
|
| 4138 | + return $this->kind; |
|
| 4139 | 4139 | } |
| 4140 | 4140 | public function setNextLink( $nextLink) { |
| 4141 | - $this->nextLink = $nextLink; |
|
| 4141 | + $this->nextLink = $nextLink; |
|
| 4142 | 4142 | } |
| 4143 | 4143 | public function getNextLink() { |
| 4144 | - return $this->nextLink; |
|
| 4144 | + return $this->nextLink; |
|
| 4145 | 4145 | } |
| 4146 | 4146 | public function setPreviousLink( $previousLink) { |
| 4147 | - $this->previousLink = $previousLink; |
|
| 4147 | + $this->previousLink = $previousLink; |
|
| 4148 | 4148 | } |
| 4149 | 4149 | public function getPreviousLink() { |
| 4150 | - return $this->previousLink; |
|
| 4150 | + return $this->previousLink; |
|
| 4151 | 4151 | } |
| 4152 | 4152 | public function setStartIndex( $startIndex) { |
| 4153 | - $this->startIndex = $startIndex; |
|
| 4153 | + $this->startIndex = $startIndex; |
|
| 4154 | 4154 | } |
| 4155 | 4155 | public function getStartIndex() { |
| 4156 | - return $this->startIndex; |
|
| 4156 | + return $this->startIndex; |
|
| 4157 | 4157 | } |
| 4158 | 4158 | public function setTotalResults( $totalResults) { |
| 4159 | - $this->totalResults = $totalResults; |
|
| 4159 | + $this->totalResults = $totalResults; |
|
| 4160 | 4160 | } |
| 4161 | 4161 | public function getTotalResults() { |
| 4162 | - return $this->totalResults; |
|
| 4162 | + return $this->totalResults; |
|
| 4163 | 4163 | } |
| 4164 | 4164 | public function setUsername( $username) { |
| 4165 | - $this->username = $username; |
|
| 4165 | + $this->username = $username; |
|
| 4166 | 4166 | } |
| 4167 | 4167 | public function getUsername() { |
| 4168 | - return $this->username; |
|
| 4168 | + return $this->username; |
|
| 4169 | 4169 | } |
| 4170 | 4170 | } |
| 4171 | 4171 | |
@@ -4193,100 +4193,100 @@ discard block |
||
| 4193 | 4193 | public $updated; |
| 4194 | 4194 | public $websiteUrl; |
| 4195 | 4195 | public function setAccountId( $accountId) { |
| 4196 | - $this->accountId = $accountId; |
|
| 4196 | + $this->accountId = $accountId; |
|
| 4197 | 4197 | } |
| 4198 | 4198 | public function getAccountId() { |
| 4199 | - return $this->accountId; |
|
| 4199 | + return $this->accountId; |
|
| 4200 | 4200 | } |
| 4201 | 4201 | public function setChildLink(Google_WebpropertyChildLink $childLink) { |
| 4202 | - $this->childLink = $childLink; |
|
| 4202 | + $this->childLink = $childLink; |
|
| 4203 | 4203 | } |
| 4204 | 4204 | public function getChildLink() { |
| 4205 | - return $this->childLink; |
|
| 4205 | + return $this->childLink; |
|
| 4206 | 4206 | } |
| 4207 | 4207 | public function setCreated( $created) { |
| 4208 | - $this->created = $created; |
|
| 4208 | + $this->created = $created; |
|
| 4209 | 4209 | } |
| 4210 | 4210 | public function getCreated() { |
| 4211 | - return $this->created; |
|
| 4211 | + return $this->created; |
|
| 4212 | 4212 | } |
| 4213 | 4213 | public function setDefaultProfileId( $defaultProfileId) { |
| 4214 | - $this->defaultProfileId = $defaultProfileId; |
|
| 4214 | + $this->defaultProfileId = $defaultProfileId; |
|
| 4215 | 4215 | } |
| 4216 | 4216 | public function getDefaultProfileId() { |
| 4217 | - return $this->defaultProfileId; |
|
| 4217 | + return $this->defaultProfileId; |
|
| 4218 | 4218 | } |
| 4219 | 4219 | public function setId( $id) { |
| 4220 | - $this->id = $id; |
|
| 4220 | + $this->id = $id; |
|
| 4221 | 4221 | } |
| 4222 | 4222 | public function getId() { |
| 4223 | - return $this->id; |
|
| 4223 | + return $this->id; |
|
| 4224 | 4224 | } |
| 4225 | 4225 | public function setIndustryVertical( $industryVertical) { |
| 4226 | - $this->industryVertical = $industryVertical; |
|
| 4226 | + $this->industryVertical = $industryVertical; |
|
| 4227 | 4227 | } |
| 4228 | 4228 | public function getIndustryVertical() { |
| 4229 | - return $this->industryVertical; |
|
| 4229 | + return $this->industryVertical; |
|
| 4230 | 4230 | } |
| 4231 | 4231 | public function setInternalWebPropertyId( $internalWebPropertyId) { |
| 4232 | - $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 4232 | + $this->internalWebPropertyId = $internalWebPropertyId; |
|
| 4233 | 4233 | } |
| 4234 | 4234 | public function getInternalWebPropertyId() { |
| 4235 | - return $this->internalWebPropertyId; |
|
| 4235 | + return $this->internalWebPropertyId; |
|
| 4236 | 4236 | } |
| 4237 | 4237 | public function setKind( $kind) { |
| 4238 | - $this->kind = $kind; |
|
| 4238 | + $this->kind = $kind; |
|
| 4239 | 4239 | } |
| 4240 | 4240 | public function getKind() { |
| 4241 | - return $this->kind; |
|
| 4241 | + return $this->kind; |
|
| 4242 | 4242 | } |
| 4243 | 4243 | public function setLevel( $level) { |
| 4244 | - $this->level = $level; |
|
| 4244 | + $this->level = $level; |
|
| 4245 | 4245 | } |
| 4246 | 4246 | public function getLevel() { |
| 4247 | - return $this->level; |
|
| 4247 | + return $this->level; |
|
| 4248 | 4248 | } |
| 4249 | 4249 | public function setName( $name) { |
| 4250 | - $this->name = $name; |
|
| 4250 | + $this->name = $name; |
|
| 4251 | 4251 | } |
| 4252 | 4252 | public function getName() { |
| 4253 | - return $this->name; |
|
| 4253 | + return $this->name; |
|
| 4254 | 4254 | } |
| 4255 | 4255 | public function setParentLink(Google_WebpropertyParentLink $parentLink) { |
| 4256 | - $this->parentLink = $parentLink; |
|
| 4256 | + $this->parentLink = $parentLink; |
|
| 4257 | 4257 | } |
| 4258 | 4258 | public function getParentLink() { |
| 4259 | - return $this->parentLink; |
|
| 4259 | + return $this->parentLink; |
|
| 4260 | 4260 | } |
| 4261 | 4261 | public function setPermissions(Google_WebpropertyPermissions $permissions) { |
| 4262 | - $this->permissions = $permissions; |
|
| 4262 | + $this->permissions = $permissions; |
|
| 4263 | 4263 | } |
| 4264 | 4264 | public function getPermissions() { |
| 4265 | - return $this->permissions; |
|
| 4265 | + return $this->permissions; |
|
| 4266 | 4266 | } |
| 4267 | 4267 | public function setProfileCount( $profileCount) { |
| 4268 | - $this->profileCount = $profileCount; |
|
| 4268 | + $this->profileCount = $profileCount; |
|
| 4269 | 4269 | } |
| 4270 | 4270 | public function getProfileCount() { |
| 4271 | - return $this->profileCount; |
|
| 4271 | + return $this->profileCount; |
|
| 4272 | 4272 | } |
| 4273 | 4273 | public function setSelfLink( $selfLink) { |
| 4274 | - $this->selfLink = $selfLink; |
|
| 4274 | + $this->selfLink = $selfLink; |
|
| 4275 | 4275 | } |
| 4276 | 4276 | public function getSelfLink() { |
| 4277 | - return $this->selfLink; |
|
| 4277 | + return $this->selfLink; |
|
| 4278 | 4278 | } |
| 4279 | 4279 | public function setUpdated( $updated) { |
| 4280 | - $this->updated = $updated; |
|
| 4280 | + $this->updated = $updated; |
|
| 4281 | 4281 | } |
| 4282 | 4282 | public function getUpdated() { |
| 4283 | - return $this->updated; |
|
| 4283 | + return $this->updated; |
|
| 4284 | 4284 | } |
| 4285 | 4285 | public function setWebsiteUrl( $websiteUrl) { |
| 4286 | - $this->websiteUrl = $websiteUrl; |
|
| 4286 | + $this->websiteUrl = $websiteUrl; |
|
| 4287 | 4287 | } |
| 4288 | 4288 | public function getWebsiteUrl() { |
| 4289 | - return $this->websiteUrl; |
|
| 4289 | + return $this->websiteUrl; |
|
| 4290 | 4290 | } |
| 4291 | 4291 | } |
| 4292 | 4292 | |
@@ -4294,16 +4294,16 @@ discard block |
||
| 4294 | 4294 | public $href; |
| 4295 | 4295 | public $type; |
| 4296 | 4296 | public function setHref( $href) { |
| 4297 | - $this->href = $href; |
|
| 4297 | + $this->href = $href; |
|
| 4298 | 4298 | } |
| 4299 | 4299 | public function getHref() { |
| 4300 | - return $this->href; |
|
| 4300 | + return $this->href; |
|
| 4301 | 4301 | } |
| 4302 | 4302 | public function setType( $type) { |
| 4303 | - $this->type = $type; |
|
| 4303 | + $this->type = $type; |
|
| 4304 | 4304 | } |
| 4305 | 4305 | public function getType() { |
| 4306 | - return $this->type; |
|
| 4306 | + return $this->type; |
|
| 4307 | 4307 | } |
| 4308 | 4308 | } |
| 4309 | 4309 | |
@@ -4311,26 +4311,26 @@ discard block |
||
| 4311 | 4311 | public $href; |
| 4312 | 4312 | public $type; |
| 4313 | 4313 | public function setHref( $href) { |
| 4314 | - $this->href = $href; |
|
| 4314 | + $this->href = $href; |
|
| 4315 | 4315 | } |
| 4316 | 4316 | public function getHref() { |
| 4317 | - return $this->href; |
|
| 4317 | + return $this->href; |
|
| 4318 | 4318 | } |
| 4319 | 4319 | public function setType( $type) { |
| 4320 | - $this->type = $type; |
|
| 4320 | + $this->type = $type; |
|
| 4321 | 4321 | } |
| 4322 | 4322 | public function getType() { |
| 4323 | - return $this->type; |
|
| 4323 | + return $this->type; |
|
| 4324 | 4324 | } |
| 4325 | 4325 | } |
| 4326 | 4326 | |
| 4327 | 4327 | class Google_WebpropertyPermissions extends Google_Model { |
| 4328 | 4328 | public $effective; |
| 4329 | 4329 | public function setEffective(/* array(Google_string) */ $effective) { |
| 4330 | - $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 4331 | - $this->effective = $effective; |
|
| 4330 | + $this->assertIsArray($effective, 'Google_string', __METHOD__); |
|
| 4331 | + $this->effective = $effective; |
|
| 4332 | 4332 | } |
| 4333 | 4333 | public function getEffective() { |
| 4334 | - return $this->effective; |
|
| 4334 | + return $this->effective; |
|
| 4335 | 4335 | } |
| 4336 | 4336 | } |
@@ -31,30 +31,30 @@ discard block |
||
| 31 | 31 | if( ! class_exists( 'URI_Template_Parser' ) ) { |
| 32 | 32 | class URI_Template_Parser { |
| 33 | 33 | |
| 34 | - public static $operators = array('+', ';', '?', '/', '.'); |
|
| 35 | - public static $reserved_operators = array('|', '!', '@'); |
|
| 36 | - public static $explode_modifiers = array('+', '*'); |
|
| 37 | - public static $partial_modifiers = array(':', '^'); |
|
| 38 | - |
|
| 39 | - public static $gen_delims = array(':', '/', '?', '#', '[', ']', '@'); |
|
| 40 | - public static $gen_delims_pct = array('%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40'); |
|
| 41 | - public static $sub_delims = array('!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '='); |
|
| 42 | - public static $sub_delims_pct = array('%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%3B', '%3D'); |
|
| 43 | - public static $reserved; |
|
| 44 | - public static $reserved_pct; |
|
| 45 | - |
|
| 46 | - public function __construct($template) { |
|
| 47 | - self::$reserved = array_merge(self::$gen_delims, self::$sub_delims); |
|
| 48 | - self::$reserved_pct = array_merge(self::$gen_delims_pct, self::$sub_delims_pct); |
|
| 49 | - $this->template = $template; |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - public function expand($data) { |
|
| 53 | - // Modification to make this a bit more performant (since gettype is very slow) |
|
| 54 | - if (! is_array($data)) { |
|
| 55 | - $data = (array)$data; |
|
| 56 | - } |
|
| 57 | - /* |
|
| 34 | + public static $operators = array('+', ';', '?', '/', '.'); |
|
| 35 | + public static $reserved_operators = array('|', '!', '@'); |
|
| 36 | + public static $explode_modifiers = array('+', '*'); |
|
| 37 | + public static $partial_modifiers = array(':', '^'); |
|
| 38 | + |
|
| 39 | + public static $gen_delims = array(':', '/', '?', '#', '[', ']', '@'); |
|
| 40 | + public static $gen_delims_pct = array('%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40'); |
|
| 41 | + public static $sub_delims = array('!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '='); |
|
| 42 | + public static $sub_delims_pct = array('%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%3B', '%3D'); |
|
| 43 | + public static $reserved; |
|
| 44 | + public static $reserved_pct; |
|
| 45 | + |
|
| 46 | + public function __construct($template) { |
|
| 47 | + self::$reserved = array_merge(self::$gen_delims, self::$sub_delims); |
|
| 48 | + self::$reserved_pct = array_merge(self::$gen_delims_pct, self::$sub_delims_pct); |
|
| 49 | + $this->template = $template; |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + public function expand($data) { |
|
| 53 | + // Modification to make this a bit more performant (since gettype is very slow) |
|
| 54 | + if (! is_array($data)) { |
|
| 55 | + $data = (array)$data; |
|
| 56 | + } |
|
| 57 | + /* |
|
| 58 | 58 | // Original code, which uses a slow gettype() statement, kept in place for if the assumption that is_array always works here is incorrect |
| 59 | 59 | switch (gettype($data)) { |
| 60 | 60 | case "boolean": |
@@ -67,146 +67,146 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | */ |
| 69 | 69 | |
| 70 | - // Resolve template vars |
|
| 71 | - preg_match_all('/\{([^\}]*)\}/', $this->template, $em); |
|
| 72 | - |
|
| 73 | - foreach ($em[1] as $i => $bare_expression) { |
|
| 74 | - preg_match('/^([\+\;\?\/\.]{1})?(.*)$/', $bare_expression, $lm); |
|
| 75 | - $exp = new StdClass(); |
|
| 76 | - $exp->expression = $em[0][$i]; |
|
| 77 | - $exp->operator = $lm[1]; |
|
| 78 | - $exp->variable_list = $lm[2]; |
|
| 79 | - $exp->varspecs = explode(',', $exp->variable_list); |
|
| 80 | - $exp->vars = array(); |
|
| 81 | - foreach ($exp->varspecs as $varspec) { |
|
| 82 | - preg_match('/^([a-zA-Z0-9_]+)([\*\+]{1})?([\:\^][0-9-]+)?(\=[^,]+)?$/', $varspec, $vm); |
|
| 83 | - $var = new StdClass(); |
|
| 84 | - $var->name = $vm[1]; |
|
| 85 | - $var->modifier = isset($vm[2]) && $vm[2] ? $vm[2] : null; |
|
| 86 | - $var->modifier = isset($vm[3]) && $vm[3] ? $vm[3] : $var->modifier; |
|
| 87 | - $var->default = isset($vm[4]) ? substr($vm[4], 1) : null; |
|
| 88 | - $exp->vars[] = $var; |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - // Add processing flags |
|
| 92 | - $exp->reserved = false; |
|
| 93 | - $exp->prefix = ''; |
|
| 94 | - $exp->delimiter = ','; |
|
| 95 | - switch ($exp->operator) { |
|
| 96 | - case '+': |
|
| 97 | - $exp->reserved = 'true'; |
|
| 98 | - break; |
|
| 99 | - case ';': |
|
| 100 | - $exp->prefix = ';'; |
|
| 101 | - $exp->delimiter = ';'; |
|
| 102 | - break; |
|
| 103 | - case '?': |
|
| 104 | - $exp->prefix = '?'; |
|
| 105 | - $exp->delimiter = '&'; |
|
| 106 | - break; |
|
| 107 | - case '/': |
|
| 108 | - $exp->prefix = '/'; |
|
| 109 | - $exp->delimiter = '/'; |
|
| 110 | - break; |
|
| 111 | - case '.': |
|
| 112 | - $exp->prefix = '.'; |
|
| 113 | - $exp->delimiter = '.'; |
|
| 114 | - break; |
|
| 115 | - } |
|
| 116 | - $expressions[] = $exp; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - // Expansion |
|
| 120 | - $this->expansion = $this->template; |
|
| 121 | - |
|
| 122 | - foreach ($expressions as $exp) { |
|
| 123 | - $part = $exp->prefix; |
|
| 124 | - $exp->one_var_defined = false; |
|
| 125 | - foreach ($exp->vars as $var) { |
|
| 126 | - $val = ''; |
|
| 127 | - if ($exp->one_var_defined && isset($data[$var->name])) { |
|
| 128 | - $part .= $exp->delimiter; |
|
| 129 | - } |
|
| 130 | - // Variable present |
|
| 131 | - if (isset($data[$var->name])) { |
|
| 132 | - $exp->one_var_defined = true; |
|
| 133 | - $var->data = $data[$var->name]; |
|
| 134 | - |
|
| 135 | - $val = self::val_from_var($var, $exp); |
|
| 136 | - |
|
| 137 | - // Variable missing |
|
| 138 | - } else { |
|
| 139 | - if ($var->default) { |
|
| 140 | - $exp->one_var_defined = true; |
|
| 141 | - $val = $var->default; |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - $part .= $val; |
|
| 145 | - } |
|
| 146 | - if (! $exp->one_var_defined) $part = ''; |
|
| 147 | - $this->expansion = str_replace($exp->expression, $part, $this->expansion); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - return $this->expansion; |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - private function val_from_var($var, $exp) { |
|
| 154 | - $val = ''; |
|
| 155 | - if (is_array($var->data)) { |
|
| 156 | - $i = 0; |
|
| 157 | - if ($exp->operator == '?' && ! $var->modifier) { |
|
| 158 | - $val .= $var->name . '='; |
|
| 159 | - } |
|
| 160 | - foreach ($var->data as $k => $v) { |
|
| 161 | - $del = $var->modifier ? $exp->delimiter : ','; |
|
| 162 | - $ek = rawurlencode($k); |
|
| 163 | - $ev = rawurlencode($v); |
|
| 164 | - |
|
| 165 | - // Array |
|
| 166 | - if ($k !== $i) { |
|
| 167 | - if ($var->modifier == '+') { |
|
| 168 | - $val .= $var->name . '.'; |
|
| 169 | - } |
|
| 170 | - if ($exp->operator == '?' && $var->modifier || $exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+') { |
|
| 171 | - $val .= $ek . '='; |
|
| 172 | - } else { |
|
| 173 | - $val .= $ek . $del; |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - // List |
|
| 177 | - } else { |
|
| 178 | - if ($var->modifier == '+') { |
|
| 179 | - if ($exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+' || $exp->operator == '?' && $var->modifier == '+') { |
|
| 180 | - $val .= $var->name . '='; |
|
| 181 | - } else { |
|
| 182 | - $val .= $var->name . '.'; |
|
| 183 | - } |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - $val .= $ev . $del; |
|
| 187 | - $i ++; |
|
| 188 | - } |
|
| 189 | - $val = trim($val, $del); |
|
| 190 | - |
|
| 191 | - // Strings, numbers, etc. |
|
| 192 | - } else { |
|
| 193 | - if ($exp->operator == '?') { |
|
| 194 | - $val = $var->name . (isset($var->data) ? '=' : ''); |
|
| 195 | - } else if ($exp->operator == ';') { |
|
| 196 | - $val = $var->name . ($var->data ? '=' : ''); |
|
| 197 | - } |
|
| 198 | - $val .= rawurlencode($var->data); |
|
| 199 | - if ($exp->operator == '+') { |
|
| 200 | - $val = str_replace(self::$reserved_pct, self::$reserved, $val); |
|
| 201 | - } |
|
| 202 | - } |
|
| 203 | - return $val; |
|
| 204 | - } |
|
| 205 | - |
|
| 206 | - public function match($uri) {} |
|
| 207 | - |
|
| 208 | - public function __toString() { |
|
| 209 | - return $this->template; |
|
| 210 | - } |
|
| 70 | + // Resolve template vars |
|
| 71 | + preg_match_all('/\{([^\}]*)\}/', $this->template, $em); |
|
| 72 | + |
|
| 73 | + foreach ($em[1] as $i => $bare_expression) { |
|
| 74 | + preg_match('/^([\+\;\?\/\.]{1})?(.*)$/', $bare_expression, $lm); |
|
| 75 | + $exp = new StdClass(); |
|
| 76 | + $exp->expression = $em[0][$i]; |
|
| 77 | + $exp->operator = $lm[1]; |
|
| 78 | + $exp->variable_list = $lm[2]; |
|
| 79 | + $exp->varspecs = explode(',', $exp->variable_list); |
|
| 80 | + $exp->vars = array(); |
|
| 81 | + foreach ($exp->varspecs as $varspec) { |
|
| 82 | + preg_match('/^([a-zA-Z0-9_]+)([\*\+]{1})?([\:\^][0-9-]+)?(\=[^,]+)?$/', $varspec, $vm); |
|
| 83 | + $var = new StdClass(); |
|
| 84 | + $var->name = $vm[1]; |
|
| 85 | + $var->modifier = isset($vm[2]) && $vm[2] ? $vm[2] : null; |
|
| 86 | + $var->modifier = isset($vm[3]) && $vm[3] ? $vm[3] : $var->modifier; |
|
| 87 | + $var->default = isset($vm[4]) ? substr($vm[4], 1) : null; |
|
| 88 | + $exp->vars[] = $var; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + // Add processing flags |
|
| 92 | + $exp->reserved = false; |
|
| 93 | + $exp->prefix = ''; |
|
| 94 | + $exp->delimiter = ','; |
|
| 95 | + switch ($exp->operator) { |
|
| 96 | + case '+': |
|
| 97 | + $exp->reserved = 'true'; |
|
| 98 | + break; |
|
| 99 | + case ';': |
|
| 100 | + $exp->prefix = ';'; |
|
| 101 | + $exp->delimiter = ';'; |
|
| 102 | + break; |
|
| 103 | + case '?': |
|
| 104 | + $exp->prefix = '?'; |
|
| 105 | + $exp->delimiter = '&'; |
|
| 106 | + break; |
|
| 107 | + case '/': |
|
| 108 | + $exp->prefix = '/'; |
|
| 109 | + $exp->delimiter = '/'; |
|
| 110 | + break; |
|
| 111 | + case '.': |
|
| 112 | + $exp->prefix = '.'; |
|
| 113 | + $exp->delimiter = '.'; |
|
| 114 | + break; |
|
| 115 | + } |
|
| 116 | + $expressions[] = $exp; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + // Expansion |
|
| 120 | + $this->expansion = $this->template; |
|
| 121 | + |
|
| 122 | + foreach ($expressions as $exp) { |
|
| 123 | + $part = $exp->prefix; |
|
| 124 | + $exp->one_var_defined = false; |
|
| 125 | + foreach ($exp->vars as $var) { |
|
| 126 | + $val = ''; |
|
| 127 | + if ($exp->one_var_defined && isset($data[$var->name])) { |
|
| 128 | + $part .= $exp->delimiter; |
|
| 129 | + } |
|
| 130 | + // Variable present |
|
| 131 | + if (isset($data[$var->name])) { |
|
| 132 | + $exp->one_var_defined = true; |
|
| 133 | + $var->data = $data[$var->name]; |
|
| 134 | + |
|
| 135 | + $val = self::val_from_var($var, $exp); |
|
| 136 | + |
|
| 137 | + // Variable missing |
|
| 138 | + } else { |
|
| 139 | + if ($var->default) { |
|
| 140 | + $exp->one_var_defined = true; |
|
| 141 | + $val = $var->default; |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + $part .= $val; |
|
| 145 | + } |
|
| 146 | + if (! $exp->one_var_defined) $part = ''; |
|
| 147 | + $this->expansion = str_replace($exp->expression, $part, $this->expansion); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + return $this->expansion; |
|
| 151 | + } |
|
| 152 | + |
|
| 153 | + private function val_from_var($var, $exp) { |
|
| 154 | + $val = ''; |
|
| 155 | + if (is_array($var->data)) { |
|
| 156 | + $i = 0; |
|
| 157 | + if ($exp->operator == '?' && ! $var->modifier) { |
|
| 158 | + $val .= $var->name . '='; |
|
| 159 | + } |
|
| 160 | + foreach ($var->data as $k => $v) { |
|
| 161 | + $del = $var->modifier ? $exp->delimiter : ','; |
|
| 162 | + $ek = rawurlencode($k); |
|
| 163 | + $ev = rawurlencode($v); |
|
| 164 | + |
|
| 165 | + // Array |
|
| 166 | + if ($k !== $i) { |
|
| 167 | + if ($var->modifier == '+') { |
|
| 168 | + $val .= $var->name . '.'; |
|
| 169 | + } |
|
| 170 | + if ($exp->operator == '?' && $var->modifier || $exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+') { |
|
| 171 | + $val .= $ek . '='; |
|
| 172 | + } else { |
|
| 173 | + $val .= $ek . $del; |
|
| 174 | + } |
|
| 175 | + |
|
| 176 | + // List |
|
| 177 | + } else { |
|
| 178 | + if ($var->modifier == '+') { |
|
| 179 | + if ($exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+' || $exp->operator == '?' && $var->modifier == '+') { |
|
| 180 | + $val .= $var->name . '='; |
|
| 181 | + } else { |
|
| 182 | + $val .= $var->name . '.'; |
|
| 183 | + } |
|
| 184 | + } |
|
| 185 | + } |
|
| 186 | + $val .= $ev . $del; |
|
| 187 | + $i ++; |
|
| 188 | + } |
|
| 189 | + $val = trim($val, $del); |
|
| 190 | + |
|
| 191 | + // Strings, numbers, etc. |
|
| 192 | + } else { |
|
| 193 | + if ($exp->operator == '?') { |
|
| 194 | + $val = $var->name . (isset($var->data) ? '=' : ''); |
|
| 195 | + } else if ($exp->operator == ';') { |
|
| 196 | + $val = $var->name . ($var->data ? '=' : ''); |
|
| 197 | + } |
|
| 198 | + $val .= rawurlencode($var->data); |
|
| 199 | + if ($exp->operator == '+') { |
|
| 200 | + $val = str_replace(self::$reserved_pct, self::$reserved, $val); |
|
| 201 | + } |
|
| 202 | + } |
|
| 203 | + return $val; |
|
| 204 | + } |
|
| 205 | + |
|
| 206 | + public function match($uri) {} |
|
| 207 | + |
|
| 208 | + public function __toString() { |
|
| 209 | + return $this->template; |
|
| 210 | + } |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | \ No newline at end of file |
@@ -27,81 +27,81 @@ discard block |
||
| 27 | 27 | private $connection = false; |
| 28 | 28 | |
| 29 | 29 | public function __construct() { |
| 30 | - global $apiConfig; |
|
| 31 | - if (! function_exists('memcache_connect')) { |
|
| 32 | - throw new Google_CacheException("Memcache functions not available"); |
|
| 33 | - } |
|
| 34 | - $this->host = $apiConfig['ioMemCacheCache_host']; |
|
| 35 | - $this->port = $apiConfig['ioMemCacheCache_port']; |
|
| 36 | - if (empty($this->host) || empty($this->port)) { |
|
| 37 | - throw new Google_CacheException("You need to supply a valid memcache host and port"); |
|
| 38 | - } |
|
| 30 | + global $apiConfig; |
|
| 31 | + if (! function_exists('memcache_connect')) { |
|
| 32 | + throw new Google_CacheException("Memcache functions not available"); |
|
| 33 | + } |
|
| 34 | + $this->host = $apiConfig['ioMemCacheCache_host']; |
|
| 35 | + $this->port = $apiConfig['ioMemCacheCache_port']; |
|
| 36 | + if (empty($this->host) || empty($this->port)) { |
|
| 37 | + throw new Google_CacheException("You need to supply a valid memcache host and port"); |
|
| 38 | + } |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | private function isLocked($key) { |
| 42 | - $this->check(); |
|
| 43 | - if ((@memcache_get($this->connection, $key . '.lock')) === false) { |
|
| 44 | - return false; |
|
| 45 | - } |
|
| 46 | - return true; |
|
| 42 | + $this->check(); |
|
| 43 | + if ((@memcache_get($this->connection, $key . '.lock')) === false) { |
|
| 44 | + return false; |
|
| 45 | + } |
|
| 46 | + return true; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | private function createLock($key) { |
| 50 | - $this->check(); |
|
| 51 | - // the interesting thing is that this could fail if the lock was created in the meantime.. |
|
| 52 | - // but we'll ignore that out of convenience |
|
| 53 | - @memcache_add($this->connection, $key . '.lock', '', 0, 5); |
|
| 50 | + $this->check(); |
|
| 51 | + // the interesting thing is that this could fail if the lock was created in the meantime.. |
|
| 52 | + // but we'll ignore that out of convenience |
|
| 53 | + @memcache_add($this->connection, $key . '.lock', '', 0, 5); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | private function removeLock($key) { |
| 57 | - $this->check(); |
|
| 58 | - // suppress all warnings, if some other process removed it that's ok too |
|
| 59 | - @memcache_delete($this->connection, $key . '.lock'); |
|
| 57 | + $this->check(); |
|
| 58 | + // suppress all warnings, if some other process removed it that's ok too |
|
| 59 | + @memcache_delete($this->connection, $key . '.lock'); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | private function waitForLock($key) { |
| 63 | - $this->check(); |
|
| 64 | - // 20 x 250 = 5 seconds |
|
| 65 | - $tries = 20; |
|
| 66 | - $cnt = 0; |
|
| 67 | - do { |
|
| 68 | - // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks.. |
|
| 69 | - usleep(250); |
|
| 70 | - $cnt ++; |
|
| 71 | - } while ($cnt <= $tries && $this->isLocked($key)); |
|
| 72 | - if ($this->isLocked($key)) { |
|
| 73 | - // 5 seconds passed, assume the owning process died off and remove it |
|
| 74 | - $this->removeLock($key); |
|
| 75 | - } |
|
| 63 | + $this->check(); |
|
| 64 | + // 20 x 250 = 5 seconds |
|
| 65 | + $tries = 20; |
|
| 66 | + $cnt = 0; |
|
| 67 | + do { |
|
| 68 | + // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks.. |
|
| 69 | + usleep(250); |
|
| 70 | + $cnt ++; |
|
| 71 | + } while ($cnt <= $tries && $this->isLocked($key)); |
|
| 72 | + if ($this->isLocked($key)) { |
|
| 73 | + // 5 seconds passed, assume the owning process died off and remove it |
|
| 74 | + $this->removeLock($key); |
|
| 75 | + } |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // I prefer lazy initialization since the cache isn't used every request |
| 79 | 79 | // so this potentially saves a lot of overhead |
| 80 | 80 | private function connect() { |
| 81 | - if (! $this->connection = @memcache_pconnect($this->host, $this->port)) { |
|
| 82 | - throw new Google_CacheException("Couldn't connect to memcache server"); |
|
| 83 | - } |
|
| 81 | + if (! $this->connection = @memcache_pconnect($this->host, $this->port)) { |
|
| 82 | + throw new Google_CacheException("Couldn't connect to memcache server"); |
|
| 83 | + } |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | private function check() { |
| 87 | - if (! $this->connection) { |
|
| 88 | - $this->connect(); |
|
| 89 | - } |
|
| 87 | + if (! $this->connection) { |
|
| 88 | + $this->connect(); |
|
| 89 | + } |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * @inheritDoc |
| 94 | 94 | */ |
| 95 | 95 | public function get($key, $expiration = false) { |
| 96 | - $this->check(); |
|
| 97 | - if (($ret = @memcache_get($this->connection, $key)) === false) { |
|
| 98 | - return false; |
|
| 99 | - } |
|
| 100 | - if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) { |
|
| 101 | - $this->delete($key); |
|
| 102 | - return false; |
|
| 103 | - } |
|
| 104 | - return $ret['data']; |
|
| 96 | + $this->check(); |
|
| 97 | + if (($ret = @memcache_get($this->connection, $key)) === false) { |
|
| 98 | + return false; |
|
| 99 | + } |
|
| 100 | + if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) { |
|
| 101 | + $this->delete($key); |
|
| 102 | + return false; |
|
| 103 | + } |
|
| 104 | + return $ret['data']; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | * @throws Google_CacheException |
| 112 | 112 | */ |
| 113 | 113 | public function set($key, $value) { |
| 114 | - $this->check(); |
|
| 115 | - // we store it with the cache_time default expiration so objects will at least get cleaned eventually. |
|
| 116 | - if (@memcache_set($this->connection, $key, array('time' => time(), |
|
| 117 | - 'data' => $value), false) == false) { |
|
| 118 | - throw new Google_CacheException("Couldn't store data in cache"); |
|
| 119 | - } |
|
| 114 | + $this->check(); |
|
| 115 | + // we store it with the cache_time default expiration so objects will at least get cleaned eventually. |
|
| 116 | + if (@memcache_set($this->connection, $key, array('time' => time(), |
|
| 117 | + 'data' => $value), false) == false) { |
|
| 118 | + throw new Google_CacheException("Couldn't store data in cache"); |
|
| 119 | + } |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @param String $key |
| 125 | 125 | */ |
| 126 | 126 | public function delete($key) { |
| 127 | - $this->check(); |
|
| 128 | - @memcache_delete($this->connection, $key); |
|
| 127 | + $this->check(); |
|
| 128 | + @memcache_delete($this->connection, $key); |
|
| 129 | 129 | } |
| 130 | 130 | } |