@@ -85,7 +85,7 @@ |
||
| 85 | 85 | /** |
| 86 | 86 | * Given a variable name, discover its type. |
| 87 | 87 | * |
| 88 | - * @param $name |
|
| 88 | + * @param string $name |
|
| 89 | 89 | * @param $item |
| 90 | 90 | * @return object The object from the item. |
| 91 | 91 | */ |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | class Google_Model { |
| 26 | 26 | public function __construct( /* polymorphic */ ) { |
| 27 | - if (func_num_args() == 1 && is_array(func_get_arg(0))) { |
|
| 28 | - // Initialize the model with the array's contents. |
|
| 29 | - $array = func_get_arg(0); |
|
| 30 | - $this->mapTypes($array); |
|
| 31 | - } |
|
| 27 | + if (func_num_args() == 1 && is_array(func_get_arg(0))) { |
|
| 28 | + // Initialize the model with the array's contents. |
|
| 29 | + $array = func_get_arg(0); |
|
| 30 | + $this->mapTypes($array); |
|
| 31 | + } |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -38,30 +38,30 @@ discard block |
||
| 38 | 38 | * @return void |
| 39 | 39 | */ |
| 40 | 40 | protected function mapTypes($array) { |
| 41 | - foreach ($array as $key => $val) { |
|
| 42 | - $this->$key = $val; |
|
| 41 | + foreach ($array as $key => $val) { |
|
| 42 | + $this->$key = $val; |
|
| 43 | 43 | |
| 44 | - $keyTypeName = "__$key" . 'Type'; |
|
| 45 | - $keyDataType = "__$key" . 'DataType'; |
|
| 46 | - if ($this->useObjects() && property_exists($this, $keyTypeName)) { |
|
| 47 | - if ($this->isAssociativeArray($val)) { |
|
| 48 | - if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) { |
|
| 49 | - foreach($val as $arrayKey => $arrayItem) { |
|
| 50 | - $val[$arrayKey] = $this->createObjectFromName($keyTypeName, $arrayItem); |
|
| 51 | - } |
|
| 52 | - $this->$key = $val; |
|
| 53 | - } else { |
|
| 54 | - $this->$key = $this->createObjectFromName($keyTypeName, $val); |
|
| 55 | - } |
|
| 56 | - } else if (is_array($val)) { |
|
| 57 | - $arrayObject = array(); |
|
| 58 | - foreach ($val as $arrayIndex => $arrayItem) { |
|
| 59 | - $arrayObject[$arrayIndex] = $this->createObjectFromName($keyTypeName, $arrayItem); |
|
| 60 | - } |
|
| 61 | - $this->$key = $arrayObject; |
|
| 62 | - } |
|
| 63 | - } |
|
| 64 | - } |
|
| 44 | + $keyTypeName = "__$key" . 'Type'; |
|
| 45 | + $keyDataType = "__$key" . 'DataType'; |
|
| 46 | + if ($this->useObjects() && property_exists($this, $keyTypeName)) { |
|
| 47 | + if ($this->isAssociativeArray($val)) { |
|
| 48 | + if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) { |
|
| 49 | + foreach($val as $arrayKey => $arrayItem) { |
|
| 50 | + $val[$arrayKey] = $this->createObjectFromName($keyTypeName, $arrayItem); |
|
| 51 | + } |
|
| 52 | + $this->$key = $val; |
|
| 53 | + } else { |
|
| 54 | + $this->$key = $this->createObjectFromName($keyTypeName, $val); |
|
| 55 | + } |
|
| 56 | + } else if (is_array($val)) { |
|
| 57 | + $arrayObject = array(); |
|
| 58 | + foreach ($val as $arrayIndex => $arrayItem) { |
|
| 59 | + $arrayObject[$arrayIndex] = $this->createObjectFromName($keyTypeName, $arrayItem); |
|
| 60 | + } |
|
| 61 | + $this->$key = $arrayObject; |
|
| 62 | + } |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -70,16 +70,16 @@ discard block |
||
| 70 | 70 | * @return bool True if the array is associative. |
| 71 | 71 | */ |
| 72 | 72 | protected function isAssociativeArray($array) { |
| 73 | - if (!is_array($array)) { |
|
| 74 | - return false; |
|
| 75 | - } |
|
| 76 | - $keys = array_keys($array); |
|
| 77 | - foreach($keys as $key) { |
|
| 78 | - if (is_string($key)) { |
|
| 79 | - return true; |
|
| 80 | - } |
|
| 81 | - } |
|
| 82 | - return false; |
|
| 73 | + if (!is_array($array)) { |
|
| 74 | + return false; |
|
| 75 | + } |
|
| 76 | + $keys = array_keys($array); |
|
| 77 | + foreach($keys as $key) { |
|
| 78 | + if (is_string($key)) { |
|
| 79 | + return true; |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | + return false; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | * @return object The object from the item. |
| 91 | 91 | */ |
| 92 | 92 | private function createObjectFromName($name, $item) { |
| 93 | - $type = $this->$name; |
|
| 94 | - return new $type($item); |
|
| 93 | + $type = $this->$name; |
|
| 94 | + return new $type($item); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | protected function useObjects() { |
| 98 | - global $apiConfig; |
|
| 99 | - return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']); |
|
| 98 | + global $apiConfig; |
|
| 99 | + return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | * @param string $method Method expecting an array as an argument. |
| 108 | 108 | */ |
| 109 | 109 | public function assertIsArray($obj, $type, $method) { |
| 110 | - if ($obj && !is_array($obj)) { |
|
| 111 | - throw new Google_Exception("Incorrect parameter type passed to $method(), expected an" |
|
| 112 | - . " array containing items of type $type."); |
|
| 113 | - } |
|
| 110 | + if ($obj && !is_array($obj)) { |
|
| 111 | + throw new Google_Exception("Incorrect parameter type passed to $method(), expected an" |
|
| 112 | + . " array containing items of type $type."); |
|
| 113 | + } |
|
| 114 | 114 | } |
| 115 | 115 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | class Google_Model { |
| 26 | 26 | public function __construct( /* polymorphic */ ) { |
| 27 | - if (func_num_args() == 1 && is_array(func_get_arg(0))) { |
|
| 27 | + if (func_num_args() == 1 && is_array(func_get_arg(0))) { |
|
| 28 | 28 | // Initialize the model with the array's contents. |
| 29 | 29 | $array = func_get_arg(0); |
| 30 | 30 | $this->mapTypes($array); |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | foreach ($array as $key => $val) { |
| 42 | 42 | $this->$key = $val; |
| 43 | 43 | |
| 44 | - $keyTypeName = "__$key" . 'Type'; |
|
| 45 | - $keyDataType = "__$key" . 'DataType'; |
|
| 44 | + $keyTypeName = "__$key".'Type'; |
|
| 45 | + $keyDataType = "__$key".'DataType'; |
|
| 46 | 46 | if ($this->useObjects() && property_exists($this, $keyTypeName)) { |
| 47 | 47 | if ($this->isAssociativeArray($val)) { |
| 48 | 48 | if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) { |
| 49 | - foreach($val as $arrayKey => $arrayItem) { |
|
| 49 | + foreach ($val as $arrayKey => $arrayItem) { |
|
| 50 | 50 | $val[$arrayKey] = $this->createObjectFromName($keyTypeName, $arrayItem); |
| 51 | 51 | } |
| 52 | 52 | $this->$key = $val; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | return false; |
| 75 | 75 | } |
| 76 | 76 | $keys = array_keys($array); |
| 77 | - foreach($keys as $key) { |
|
| 77 | + foreach ($keys as $key) { |
|
| 78 | 78 | if (is_string($key)) { |
| 79 | 79 | return true; |
| 80 | 80 | } |
@@ -53,6 +53,11 @@ discard block |
||
| 53 | 53 | /** @var array $methods */ |
| 54 | 54 | private $methods; |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @param Google_AnalyticsService $service |
|
| 58 | + * @param string $serviceName |
|
| 59 | + * @param string $resourceName |
|
| 60 | + */ |
|
| 56 | 61 | public function __construct($service, $serviceName, $resourceName, $resource) { |
| 57 | 62 | $this->service = $service; |
| 58 | 63 | $this->serviceName = $serviceName; |
@@ -61,7 +66,7 @@ discard block |
||
| 61 | 66 | } |
| 62 | 67 | |
| 63 | 68 | /** |
| 64 | - * @param $name |
|
| 69 | + * @param string $name |
|
| 65 | 70 | * @param $arguments |
| 66 | 71 | * @return Google_HttpRequest|array |
| 67 | 72 | * @throws Google_Exception |
@@ -27,18 +27,18 @@ discard block |
||
| 27 | 27 | class Google_ServiceResource { |
| 28 | 28 | // Valid query parameters that work, but don't appear in discovery. |
| 29 | 29 | private $stackParameters = array( |
| 30 | - 'alt' => array('type' => 'string', 'location' => 'query'), |
|
| 31 | - 'boundary' => array('type' => 'string', 'location' => 'query'), |
|
| 32 | - 'fields' => array('type' => 'string', 'location' => 'query'), |
|
| 33 | - 'trace' => array('type' => 'string', 'location' => 'query'), |
|
| 34 | - 'userIp' => array('type' => 'string', 'location' => 'query'), |
|
| 35 | - 'userip' => array('type' => 'string', 'location' => 'query'), |
|
| 36 | - 'quotaUser' => array('type' => 'string', 'location' => 'query'), |
|
| 37 | - 'file' => array('type' => 'complex', 'location' => 'body'), |
|
| 38 | - 'data' => array('type' => 'string', 'location' => 'body'), |
|
| 39 | - 'mimeType' => array('type' => 'string', 'location' => 'header'), |
|
| 40 | - 'uploadType' => array('type' => 'string', 'location' => 'query'), |
|
| 41 | - 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), |
|
| 30 | + 'alt' => array('type' => 'string', 'location' => 'query'), |
|
| 31 | + 'boundary' => array('type' => 'string', 'location' => 'query'), |
|
| 32 | + 'fields' => array('type' => 'string', 'location' => 'query'), |
|
| 33 | + 'trace' => array('type' => 'string', 'location' => 'query'), |
|
| 34 | + 'userIp' => array('type' => 'string', 'location' => 'query'), |
|
| 35 | + 'userip' => array('type' => 'string', 'location' => 'query'), |
|
| 36 | + 'quotaUser' => array('type' => 'string', 'location' => 'query'), |
|
| 37 | + 'file' => array('type' => 'complex', 'location' => 'body'), |
|
| 38 | + 'data' => array('type' => 'string', 'location' => 'body'), |
|
| 39 | + 'mimeType' => array('type' => 'string', 'location' => 'header'), |
|
| 40 | + 'uploadType' => array('type' => 'string', 'location' => 'query'), |
|
| 41 | + 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), |
|
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | /** @var Google_Service $service */ |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | private $methods; |
| 55 | 55 | |
| 56 | 56 | public function __construct($service, $serviceName, $resourceName, $resource) { |
| 57 | - $this->service = $service; |
|
| 58 | - $this->serviceName = $serviceName; |
|
| 59 | - $this->resourceName = $resourceName; |
|
| 60 | - $this->methods = isset($resource['methods']) ? $resource['methods'] : array($resourceName => $resource); |
|
| 57 | + $this->service = $service; |
|
| 58 | + $this->serviceName = $serviceName; |
|
| 59 | + $this->resourceName = $resourceName; |
|
| 60 | + $this->methods = isset($resource['methods']) ? $resource['methods'] : array($resourceName => $resource); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,139 +67,139 @@ discard block |
||
| 67 | 67 | * @throws Google_Exception |
| 68 | 68 | */ |
| 69 | 69 | public function __call($name, $arguments) { |
| 70 | - if (! isset($this->methods[$name])) { |
|
| 71 | - throw new Google_Exception("Unknown function: {$this->serviceName}->{$this->resourceName}->{$name}()"); |
|
| 72 | - } |
|
| 73 | - $method = $this->methods[$name]; |
|
| 74 | - $parameters = $arguments[0]; |
|
| 75 | - |
|
| 76 | - // postBody is a special case since it's not defined in the discovery document as parameter, but we abuse the param entry for storing it |
|
| 77 | - $postBody = null; |
|
| 78 | - if (isset($parameters['postBody'])) { |
|
| 79 | - if (is_object($parameters['postBody'])) { |
|
| 80 | - $this->stripNull($parameters['postBody']); |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - // Some APIs require the postBody to be set under the data key. |
|
| 84 | - if (is_array($parameters['postBody']) && 'latitude' == $this->serviceName) { |
|
| 85 | - if (!isset($parameters['postBody']['data'])) { |
|
| 86 | - $rawBody = $parameters['postBody']; |
|
| 87 | - unset($parameters['postBody']); |
|
| 88 | - $parameters['postBody']['data'] = $rawBody; |
|
| 89 | - } |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - $postBody = is_array($parameters['postBody']) || is_object($parameters['postBody']) |
|
| 93 | - ? json_encode($parameters['postBody']) |
|
| 94 | - : $parameters['postBody']; |
|
| 95 | - unset($parameters['postBody']); |
|
| 96 | - |
|
| 97 | - if (isset($parameters['optParams'])) { |
|
| 98 | - $optParams = $parameters['optParams']; |
|
| 99 | - unset($parameters['optParams']); |
|
| 100 | - $parameters = array_merge($parameters, $optParams); |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - if (!isset($method['parameters'])) { |
|
| 105 | - $method['parameters'] = array(); |
|
| 106 | - } |
|
| 70 | + if (! isset($this->methods[$name])) { |
|
| 71 | + throw new Google_Exception("Unknown function: {$this->serviceName}->{$this->resourceName}->{$name}()"); |
|
| 72 | + } |
|
| 73 | + $method = $this->methods[$name]; |
|
| 74 | + $parameters = $arguments[0]; |
|
| 75 | + |
|
| 76 | + // postBody is a special case since it's not defined in the discovery document as parameter, but we abuse the param entry for storing it |
|
| 77 | + $postBody = null; |
|
| 78 | + if (isset($parameters['postBody'])) { |
|
| 79 | + if (is_object($parameters['postBody'])) { |
|
| 80 | + $this->stripNull($parameters['postBody']); |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + // Some APIs require the postBody to be set under the data key. |
|
| 84 | + if (is_array($parameters['postBody']) && 'latitude' == $this->serviceName) { |
|
| 85 | + if (!isset($parameters['postBody']['data'])) { |
|
| 86 | + $rawBody = $parameters['postBody']; |
|
| 87 | + unset($parameters['postBody']); |
|
| 88 | + $parameters['postBody']['data'] = $rawBody; |
|
| 89 | + } |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + $postBody = is_array($parameters['postBody']) || is_object($parameters['postBody']) |
|
| 93 | + ? json_encode($parameters['postBody']) |
|
| 94 | + : $parameters['postBody']; |
|
| 95 | + unset($parameters['postBody']); |
|
| 96 | + |
|
| 97 | + if (isset($parameters['optParams'])) { |
|
| 98 | + $optParams = $parameters['optParams']; |
|
| 99 | + unset($parameters['optParams']); |
|
| 100 | + $parameters = array_merge($parameters, $optParams); |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + if (!isset($method['parameters'])) { |
|
| 105 | + $method['parameters'] = array(); |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - $method['parameters'] = array_merge($method['parameters'], $this->stackParameters); |
|
| 109 | - foreach ($parameters as $key => $val) { |
|
| 110 | - if ($key != 'postBody' && ! isset($method['parameters'][$key])) { |
|
| 111 | - throw new Google_Exception("($name) unknown parameter: '$key'"); |
|
| 112 | - } |
|
| 113 | - } |
|
| 114 | - if (isset($method['parameters'])) { |
|
| 115 | - foreach ($method['parameters'] as $paramName => $paramSpec) { |
|
| 116 | - if (isset($paramSpec['required']) && $paramSpec['required'] && ! isset($parameters[$paramName])) { |
|
| 117 | - throw new Google_Exception("($name) missing required param: '$paramName'"); |
|
| 118 | - } |
|
| 119 | - if (isset($parameters[$paramName])) { |
|
| 120 | - $value = $parameters[$paramName]; |
|
| 121 | - $parameters[$paramName] = $paramSpec; |
|
| 122 | - $parameters[$paramName]['value'] = $value; |
|
| 123 | - unset($parameters[$paramName]['required']); |
|
| 124 | - } else { |
|
| 125 | - unset($parameters[$paramName]); |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - // Discovery v1.0 puts the canonical method id under the 'id' field. |
|
| 131 | - if (! isset($method['id'])) { |
|
| 132 | - $method['id'] = $method['rpcMethod']; |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - // Discovery v1.0 puts the canonical path under the 'path' field. |
|
| 136 | - if (! isset($method['path'])) { |
|
| 137 | - $method['path'] = $method['restPath']; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - $servicePath = $this->service->servicePath; |
|
| 141 | - |
|
| 142 | - // Process Media Request |
|
| 143 | - $contentType = false; |
|
| 144 | - if (isset($method['mediaUpload'])) { |
|
| 145 | - $media = Google_MediaFileUpload::process($postBody, $parameters); |
|
| 146 | - if ($media) { |
|
| 147 | - $contentType = isset($media['content-type']) ? $media['content-type']: null; |
|
| 148 | - $postBody = isset($media['postBody']) ? $media['postBody'] : null; |
|
| 149 | - $servicePath = $method['mediaUpload']['protocols']['simple']['path']; |
|
| 150 | - $method['path'] = ''; |
|
| 151 | - } |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - $url = Google_REST::createRequestUri($servicePath, $method['path'], $parameters); |
|
| 155 | - $httpRequest = new Google_HttpRequest($url, $method['httpMethod'], null, $postBody); |
|
| 156 | - if ($postBody) { |
|
| 157 | - $contentTypeHeader = array(); |
|
| 158 | - if (isset($contentType) && $contentType) { |
|
| 159 | - $contentTypeHeader['content-type'] = $contentType; |
|
| 160 | - } else { |
|
| 161 | - $contentTypeHeader['content-type'] = 'application/json; charset=UTF-8'; |
|
| 162 | - $contentTypeHeader['content-length'] = Google_Utils::getStrLen($postBody); |
|
| 163 | - } |
|
| 164 | - $httpRequest->setRequestHeaders($contentTypeHeader); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - $httpRequest = Google_Client::$auth->sign($httpRequest); |
|
| 168 | - if (Google_Client::$useBatch) { |
|
| 169 | - return $httpRequest; |
|
| 170 | - } |
|
| 171 | - |
|
| 172 | - // Terminate immediately if this is a resumable request. |
|
| 173 | - if (isset($parameters['uploadType']['value']) |
|
| 174 | - && Google_MediaFileUpload::UPLOAD_RESUMABLE_TYPE == $parameters['uploadType']['value']) { |
|
| 175 | - $contentTypeHeader = array(); |
|
| 176 | - if (isset($contentType) && $contentType) { |
|
| 177 | - $contentTypeHeader['content-type'] = $contentType; |
|
| 178 | - } |
|
| 179 | - $httpRequest->setRequestHeaders($contentTypeHeader); |
|
| 180 | - if ($postBody) { |
|
| 181 | - $httpRequest->setPostBody($postBody); |
|
| 182 | - } |
|
| 183 | - return $httpRequest; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - return Google_REST::execute($httpRequest); |
|
| 108 | + $method['parameters'] = array_merge($method['parameters'], $this->stackParameters); |
|
| 109 | + foreach ($parameters as $key => $val) { |
|
| 110 | + if ($key != 'postBody' && ! isset($method['parameters'][$key])) { |
|
| 111 | + throw new Google_Exception("($name) unknown parameter: '$key'"); |
|
| 112 | + } |
|
| 113 | + } |
|
| 114 | + if (isset($method['parameters'])) { |
|
| 115 | + foreach ($method['parameters'] as $paramName => $paramSpec) { |
|
| 116 | + if (isset($paramSpec['required']) && $paramSpec['required'] && ! isset($parameters[$paramName])) { |
|
| 117 | + throw new Google_Exception("($name) missing required param: '$paramName'"); |
|
| 118 | + } |
|
| 119 | + if (isset($parameters[$paramName])) { |
|
| 120 | + $value = $parameters[$paramName]; |
|
| 121 | + $parameters[$paramName] = $paramSpec; |
|
| 122 | + $parameters[$paramName]['value'] = $value; |
|
| 123 | + unset($parameters[$paramName]['required']); |
|
| 124 | + } else { |
|
| 125 | + unset($parameters[$paramName]); |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + // Discovery v1.0 puts the canonical method id under the 'id' field. |
|
| 131 | + if (! isset($method['id'])) { |
|
| 132 | + $method['id'] = $method['rpcMethod']; |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + // Discovery v1.0 puts the canonical path under the 'path' field. |
|
| 136 | + if (! isset($method['path'])) { |
|
| 137 | + $method['path'] = $method['restPath']; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + $servicePath = $this->service->servicePath; |
|
| 141 | + |
|
| 142 | + // Process Media Request |
|
| 143 | + $contentType = false; |
|
| 144 | + if (isset($method['mediaUpload'])) { |
|
| 145 | + $media = Google_MediaFileUpload::process($postBody, $parameters); |
|
| 146 | + if ($media) { |
|
| 147 | + $contentType = isset($media['content-type']) ? $media['content-type']: null; |
|
| 148 | + $postBody = isset($media['postBody']) ? $media['postBody'] : null; |
|
| 149 | + $servicePath = $method['mediaUpload']['protocols']['simple']['path']; |
|
| 150 | + $method['path'] = ''; |
|
| 151 | + } |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + $url = Google_REST::createRequestUri($servicePath, $method['path'], $parameters); |
|
| 155 | + $httpRequest = new Google_HttpRequest($url, $method['httpMethod'], null, $postBody); |
|
| 156 | + if ($postBody) { |
|
| 157 | + $contentTypeHeader = array(); |
|
| 158 | + if (isset($contentType) && $contentType) { |
|
| 159 | + $contentTypeHeader['content-type'] = $contentType; |
|
| 160 | + } else { |
|
| 161 | + $contentTypeHeader['content-type'] = 'application/json; charset=UTF-8'; |
|
| 162 | + $contentTypeHeader['content-length'] = Google_Utils::getStrLen($postBody); |
|
| 163 | + } |
|
| 164 | + $httpRequest->setRequestHeaders($contentTypeHeader); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + $httpRequest = Google_Client::$auth->sign($httpRequest); |
|
| 168 | + if (Google_Client::$useBatch) { |
|
| 169 | + return $httpRequest; |
|
| 170 | + } |
|
| 171 | + |
|
| 172 | + // Terminate immediately if this is a resumable request. |
|
| 173 | + if (isset($parameters['uploadType']['value']) |
|
| 174 | + && Google_MediaFileUpload::UPLOAD_RESUMABLE_TYPE == $parameters['uploadType']['value']) { |
|
| 175 | + $contentTypeHeader = array(); |
|
| 176 | + if (isset($contentType) && $contentType) { |
|
| 177 | + $contentTypeHeader['content-type'] = $contentType; |
|
| 178 | + } |
|
| 179 | + $httpRequest->setRequestHeaders($contentTypeHeader); |
|
| 180 | + if ($postBody) { |
|
| 181 | + $httpRequest->setPostBody($postBody); |
|
| 182 | + } |
|
| 183 | + return $httpRequest; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + return Google_REST::execute($httpRequest); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | public function useObjects() { |
| 190 | - global $apiConfig; |
|
| 191 | - return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']); |
|
| 190 | + global $apiConfig; |
|
| 191 | + return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | protected function stripNull(&$o) { |
| 195 | - $o = (array) $o; |
|
| 196 | - foreach ($o as $k => $v) { |
|
| 197 | - if ($v === null || strstr($k, "\0*\0__")) { |
|
| 198 | - unset($o[$k]); |
|
| 199 | - } |
|
| 200 | - elseif (is_object($v) || is_array($v)) { |
|
| 201 | - $this->stripNull($o[$k]); |
|
| 202 | - } |
|
| 203 | - } |
|
| 195 | + $o = (array) $o; |
|
| 196 | + foreach ($o as $k => $v) { |
|
| 197 | + if ($v === null || strstr($k, "\0*\0__")) { |
|
| 198 | + unset($o[$k]); |
|
| 199 | + } |
|
| 200 | + elseif (is_object($v) || is_array($v)) { |
|
| 201 | + $this->stripNull($o[$k]); |
|
| 202 | + } |
|
| 203 | + } |
|
| 204 | 204 | } |
| 205 | 205 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @throws Google_Exception |
| 68 | 68 | */ |
| 69 | 69 | public function __call($name, $arguments) { |
| 70 | - if (! isset($this->methods[$name])) { |
|
| 70 | + if (!isset($this->methods[$name])) { |
|
| 71 | 71 | throw new Google_Exception("Unknown function: {$this->serviceName}->{$this->resourceName}->{$name}()"); |
| 72 | 72 | } |
| 73 | 73 | $method = $this->methods[$name]; |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $method['parameters'] = array_merge($method['parameters'], $this->stackParameters); |
| 109 | 109 | foreach ($parameters as $key => $val) { |
| 110 | - if ($key != 'postBody' && ! isset($method['parameters'][$key])) { |
|
| 110 | + if ($key != 'postBody' && !isset($method['parameters'][$key])) { |
|
| 111 | 111 | throw new Google_Exception("($name) unknown parameter: '$key'"); |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | if (isset($method['parameters'])) { |
| 115 | 115 | foreach ($method['parameters'] as $paramName => $paramSpec) { |
| 116 | - if (isset($paramSpec['required']) && $paramSpec['required'] && ! isset($parameters[$paramName])) { |
|
| 116 | + if (isset($paramSpec['required']) && $paramSpec['required'] && !isset($parameters[$paramName])) { |
|
| 117 | 117 | throw new Google_Exception("($name) missing required param: '$paramName'"); |
| 118 | 118 | } |
| 119 | 119 | if (isset($parameters[$paramName])) { |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // Discovery v1.0 puts the canonical method id under the 'id' field. |
| 131 | - if (! isset($method['id'])) { |
|
| 131 | + if (!isset($method['id'])) { |
|
| 132 | 132 | $method['id'] = $method['rpcMethod']; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // Discovery v1.0 puts the canonical path under the 'path' field. |
| 136 | - if (! isset($method['path'])) { |
|
| 136 | + if (!isset($method['path'])) { |
|
| 137 | 137 | $method['path'] = $method['restPath']; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if (isset($method['mediaUpload'])) { |
| 145 | 145 | $media = Google_MediaFileUpload::process($postBody, $parameters); |
| 146 | 146 | if ($media) { |
| 147 | - $contentType = isset($media['content-type']) ? $media['content-type']: null; |
|
| 147 | + $contentType = isset($media['content-type']) ? $media['content-type'] : null; |
|
| 148 | 148 | $postBody = isset($media['postBody']) ? $media['postBody'] : null; |
| 149 | 149 | $servicePath = $method['mediaUpload']['protocols']['simple']['path']; |
| 150 | 150 | $method['path'] = ''; |
@@ -196,8 +196,7 @@ |
||
| 196 | 196 | foreach ($o as $k => $v) { |
| 197 | 197 | if ($v === null || strstr($k, "\0*\0__")) { |
| 198 | 198 | unset($o[$k]); |
| 199 | - } |
|
| 200 | - elseif (is_object($v) || is_array($v)) { |
|
| 199 | + } elseif (is_object($v) || is_array($v)) { |
|
| 201 | 200 | $this->stripNull($o[$k]); |
| 202 | 201 | } |
| 203 | 202 | } |
@@ -22,6 +22,10 @@ |
||
| 22 | 22 | * @author Chirag Shah <[email protected]> |
| 23 | 23 | */ |
| 24 | 24 | class Google_Utils { |
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * @param string $data |
|
| 28 | + */ |
|
| 25 | 29 | public static function urlSafeB64Encode($data) { |
| 26 | 30 | $b64 = base64_encode($data); |
| 27 | 31 | $b64 = str_replace(array('+', '/', '\r', '\n', '='), |
@@ -23,18 +23,18 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | class Google_Utils { |
| 25 | 25 | public static function urlSafeB64Encode($data) { |
| 26 | - $b64 = base64_encode($data); |
|
| 27 | - $b64 = str_replace(array('+', '/', '\r', '\n', '='), |
|
| 28 | - array('-', '_'), |
|
| 29 | - $b64); |
|
| 30 | - return $b64; |
|
| 26 | + $b64 = base64_encode($data); |
|
| 27 | + $b64 = str_replace(array('+', '/', '\r', '\n', '='), |
|
| 28 | + array('-', '_'), |
|
| 29 | + $b64); |
|
| 30 | + return $b64; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public static function urlSafeB64Decode($b64) { |
| 34 | - $b64 = str_replace(array('-', '_'), |
|
| 35 | - array('+', '/'), |
|
| 36 | - $b64); |
|
| 37 | - return base64_decode($b64); |
|
| 34 | + $b64 = str_replace(array('-', '_'), |
|
| 35 | + array('+', '/'), |
|
| 36 | + $b64); |
|
| 37 | + return base64_decode($b64); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -52,50 +52,50 @@ discard block |
||
| 52 | 52 | * @return int The number of bytes in a string. |
| 53 | 53 | */ |
| 54 | 54 | static public function getStrLen($str) { |
| 55 | - $strlenVar = strlen($str); |
|
| 56 | - $d = $ret = 0; |
|
| 57 | - for ($count = 0; $count < $strlenVar; ++ $count) { |
|
| 58 | - $ordinalValue = ord($str{$ret}); |
|
| 59 | - switch (true) { |
|
| 60 | - case (($ordinalValue >= 0x20) && ($ordinalValue <= 0x7F)): |
|
| 61 | - // characters U-00000000 - U-0000007F (same as ASCII) |
|
| 62 | - $ret ++; |
|
| 63 | - break; |
|
| 55 | + $strlenVar = strlen($str); |
|
| 56 | + $d = $ret = 0; |
|
| 57 | + for ($count = 0; $count < $strlenVar; ++ $count) { |
|
| 58 | + $ordinalValue = ord($str{$ret}); |
|
| 59 | + switch (true) { |
|
| 60 | + case (($ordinalValue >= 0x20) && ($ordinalValue <= 0x7F)): |
|
| 61 | + // characters U-00000000 - U-0000007F (same as ASCII) |
|
| 62 | + $ret ++; |
|
| 63 | + break; |
|
| 64 | 64 | |
| 65 | - case (($ordinalValue & 0xE0) == 0xC0): |
|
| 66 | - // characters U-00000080 - U-000007FF, mask 110XXXXX |
|
| 67 | - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 68 | - $ret += 2; |
|
| 69 | - break; |
|
| 65 | + case (($ordinalValue & 0xE0) == 0xC0): |
|
| 66 | + // characters U-00000080 - U-000007FF, mask 110XXXXX |
|
| 67 | + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 68 | + $ret += 2; |
|
| 69 | + break; |
|
| 70 | 70 | |
| 71 | - case (($ordinalValue & 0xF0) == 0xE0): |
|
| 72 | - // characters U-00000800 - U-0000FFFF, mask 1110XXXX |
|
| 73 | - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 74 | - $ret += 3; |
|
| 75 | - break; |
|
| 71 | + case (($ordinalValue & 0xF0) == 0xE0): |
|
| 72 | + // characters U-00000800 - U-0000FFFF, mask 1110XXXX |
|
| 73 | + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 74 | + $ret += 3; |
|
| 75 | + break; |
|
| 76 | 76 | |
| 77 | - case (($ordinalValue & 0xF8) == 0xF0): |
|
| 78 | - // characters U-00010000 - U-001FFFFF, mask 11110XXX |
|
| 79 | - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 80 | - $ret += 4; |
|
| 81 | - break; |
|
| 77 | + case (($ordinalValue & 0xF8) == 0xF0): |
|
| 78 | + // characters U-00010000 - U-001FFFFF, mask 11110XXX |
|
| 79 | + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 80 | + $ret += 4; |
|
| 81 | + break; |
|
| 82 | 82 | |
| 83 | - case (($ordinalValue & 0xFC) == 0xF8): |
|
| 84 | - // characters U-00200000 - U-03FFFFFF, mask 111110XX |
|
| 85 | - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 86 | - $ret += 5; |
|
| 87 | - break; |
|
| 83 | + case (($ordinalValue & 0xFC) == 0xF8): |
|
| 84 | + // characters U-00200000 - U-03FFFFFF, mask 111110XX |
|
| 85 | + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 86 | + $ret += 5; |
|
| 87 | + break; |
|
| 88 | 88 | |
| 89 | - case (($ordinalValue & 0xFE) == 0xFC): |
|
| 90 | - // characters U-04000000 - U-7FFFFFFF, mask 1111110X |
|
| 91 | - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 92 | - $ret += 6; |
|
| 93 | - break; |
|
| 94 | - default: |
|
| 95 | - $ret ++; |
|
| 96 | - } |
|
| 97 | - } |
|
| 98 | - return $ret; |
|
| 89 | + case (($ordinalValue & 0xFE) == 0xFC): |
|
| 90 | + // characters U-04000000 - U-7FFFFFFF, mask 1111110X |
|
| 91 | + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 92 | + $ret += 6; |
|
| 93 | + break; |
|
| 94 | + default: |
|
| 95 | + $ret ++; |
|
| 96 | + } |
|
| 97 | + } |
|
| 98 | + return $ret; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -104,14 +104,14 @@ discard block |
||
| 104 | 104 | * @return array Normalized array. |
| 105 | 105 | */ |
| 106 | 106 | public static function normalize($arr) { |
| 107 | - if (!is_array($arr)) { |
|
| 108 | - return array(); |
|
| 109 | - } |
|
| 107 | + if (!is_array($arr)) { |
|
| 108 | + return array(); |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - $normalized = array(); |
|
| 112 | - foreach ($arr as $key => $val) { |
|
| 113 | - $normalized[strtolower($key)] = $val; |
|
| 114 | - } |
|
| 115 | - return $normalized; |
|
| 111 | + $normalized = array(); |
|
| 112 | + foreach ($arr as $key => $val) { |
|
| 113 | + $normalized[strtolower($key)] = $val; |
|
| 114 | + } |
|
| 115 | + return $normalized; |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | \ No newline at end of file |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | switch (true) { |
| 60 | 60 | case (($ordinalValue >= 0x20) && ($ordinalValue <= 0x7F)): |
| 61 | 61 | // characters U-00000000 - U-0000007F (same as ASCII) |
| 62 | - $ret ++; |
|
| 62 | + $ret++; |
|
| 63 | 63 | break; |
| 64 | 64 | |
| 65 | 65 | case (($ordinalValue & 0xE0) == 0xC0): |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $ret += 6; |
| 93 | 93 | break; |
| 94 | 94 | default: |
| 95 | - $ret ++; |
|
| 95 | + $ret++; |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | return $ret; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | * @param string $page Page url to use in analytics filters. |
| 56 | 56 | * @param bool $ga_start The start date of the data to include in YYYY-MM-DD format. |
| 57 | 57 | * @param bool $ga_end The end date of the data to include in YYYY-MM-DD format. |
| 58 | - * @return string Html text content. |
|
| 58 | + * @return false|null Html text content. |
|
| 59 | 59 | */ |
| 60 | 60 | function geodir_getGoogleAnalytics($page, $ga_start, $ga_end) |
| 61 | 61 | {
|
@@ -17,34 +17,34 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function geodir_sec2hms($sec, $padHours = false) |
| 19 | 19 | {
|
| 20 | - // holds formatted string |
|
| 21 | - $hms = ""; |
|
| 22 | - // there are 3600 seconds in an hour, so if we |
|
| 23 | - // divide total seconds by 3600 and throw away |
|
| 24 | - // the remainder, we've got the number of hours |
|
| 25 | - $hours = intval(intval($sec) / 3600); |
|
| 26 | - |
|
| 27 | - // add to $hms, with a leading 0 if asked for |
|
| 28 | - $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; |
|
| 29 | - |
|
| 30 | - // dividing the total seconds by 60 will give us |
|
| 31 | - // the number of minutes, but we're interested in |
|
| 32 | - // minutes past the hour: to get that, we need to |
|
| 33 | - // divide by 60 again and keep the remainder |
|
| 34 | - $minutes = intval(($sec / 60) % 60); |
|
| 35 | - |
|
| 36 | - // then add to $hms (with a leading 0 if needed) |
|
| 37 | - $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; |
|
| 38 | - |
|
| 39 | - // seconds are simple - just divide the total |
|
| 40 | - // seconds by 60 and keep the remainder |
|
| 41 | - $seconds = intval($sec % 60); |
|
| 42 | - |
|
| 43 | - // add to $hms, again with a leading 0 if needed |
|
| 44 | - $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); |
|
| 45 | - |
|
| 46 | - // done! |
|
| 47 | - return $hms; |
|
| 20 | + // holds formatted string |
|
| 21 | + $hms = ""; |
|
| 22 | + // there are 3600 seconds in an hour, so if we |
|
| 23 | + // divide total seconds by 3600 and throw away |
|
| 24 | + // the remainder, we've got the number of hours |
|
| 25 | + $hours = intval(intval($sec) / 3600); |
|
| 26 | + |
|
| 27 | + // add to $hms, with a leading 0 if asked for |
|
| 28 | + $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; |
|
| 29 | + |
|
| 30 | + // dividing the total seconds by 60 will give us |
|
| 31 | + // the number of minutes, but we're interested in |
|
| 32 | + // minutes past the hour: to get that, we need to |
|
| 33 | + // divide by 60 again and keep the remainder |
|
| 34 | + $minutes = intval(($sec / 60) % 60); |
|
| 35 | + |
|
| 36 | + // then add to $hms (with a leading 0 if needed) |
|
| 37 | + $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; |
|
| 38 | + |
|
| 39 | + // seconds are simple - just divide the total |
|
| 40 | + // seconds by 60 and keep the remainder |
|
| 41 | + $seconds = intval($sec % 60); |
|
| 42 | + |
|
| 43 | + // add to $hms, again with a leading 0 if needed |
|
| 44 | + $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); |
|
| 45 | + |
|
| 46 | + // done! |
|
| 47 | + return $hms; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -60,122 +60,122 @@ discard block |
||
| 60 | 60 | function geodir_getGoogleAnalytics($page, $ga_start, $ga_end) |
| 61 | 61 | {
|
| 62 | 62 | |
| 63 | - // NEW ANALYTICS |
|
| 64 | - |
|
| 65 | - $start_date = ''; |
|
| 66 | - $end_date = ''; |
|
| 67 | - $dimensions = ''; |
|
| 68 | - $sort = ''; |
|
| 69 | - $filters = "ga:pagePath==".$page; |
|
| 70 | - $metrics = "ga:pageviews"; |
|
| 71 | - $realtime = false; |
|
| 72 | - $limit = false; |
|
| 73 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){
|
|
| 74 | - $start_date = date('Y-m-d', strtotime("-6 day"));
|
|
| 75 | - $end_date = date('Y-m-d');
|
|
| 76 | - $dimensions = "ga:date,ga:nthDay"; |
|
| 77 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
|
|
| 78 | - $start_date = date('Y-m-d', strtotime("-13 day"));
|
|
| 79 | - $end_date = date('Y-m-d', strtotime("-7 day"));
|
|
| 80 | - $dimensions = "ga:date,ga:nthDay"; |
|
| 81 | - } |
|
| 82 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
|
|
| 83 | - $start_date = date('Y')."-01-01";
|
|
| 84 | - $end_date = date('Y-m-d');
|
|
| 85 | - $dimensions = "ga:month,ga:nthMonth"; |
|
| 86 | - } |
|
| 87 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
|
|
| 88 | - $start_date = date('Y', strtotime("-1 year"))."-01-01";
|
|
| 89 | - $end_date = date('Y', strtotime("-1 year"))."-12-31";
|
|
| 90 | - $dimensions = "ga:month,ga:nthMonth"; |
|
| 91 | - } |
|
| 92 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
|
|
| 93 | - $start_date = "14daysAgo"; |
|
| 94 | - $end_date = "yesterday"; |
|
| 95 | - $dimensions = "ga:country"; |
|
| 96 | - $sort = "ga:pageviews"; |
|
| 97 | - $limit = 5; |
|
| 98 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){
|
|
| 99 | - $metrics = "rt:activeUsers"; |
|
| 100 | - $realtime = true; |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - # Create a new Gdata call |
|
| 104 | - $gaApi = new GDGoogleAnalyticsStats(); |
|
| 105 | - |
|
| 106 | - # Check if Google sucessfully logged in |
|
| 107 | - if (!$gaApi->checkLogin()){
|
|
| 108 | - echo json_encode(array('error'=>__('Please check Google Analytics Settings','geodirectory')));
|
|
| 109 | - return false; |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - $account = $gaApi->getSingleProfile(); |
|
| 113 | - |
|
| 114 | - if(!isset($account[0]['id'])){
|
|
| 115 | - echo json_encode(array('error'=>__('Please check Google Analytics Settings','geodirectory')));
|
|
| 116 | - return false; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - $account = $account[0]['id']; |
|
| 120 | - |
|
| 121 | - # Set the account to the one requested |
|
| 122 | - $gaApi->setAccount($account); |
|
| 123 | - |
|
| 124 | - |
|
| 125 | - |
|
| 126 | - # Get the metrics needed to build the visits graph; |
|
| 127 | - try {
|
|
| 128 | - $stats = $gaApi->getMetrics($metrics, $start_date, $end_date, $dimensions, $sort, $filters, $limit , $realtime); |
|
| 129 | - } |
|
| 130 | - catch (Exception $e) {
|
|
| 131 | - print 'GA Summary Widget - there was a service error ' . $e->getCode() . ':' . $e->getMessage(); |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - |
|
| 135 | - //print_r($stats); |
|
| 136 | - echo json_encode($stats); |
|
| 137 | - exit; |
|
| 63 | + // NEW ANALYTICS |
|
| 64 | + |
|
| 65 | + $start_date = ''; |
|
| 66 | + $end_date = ''; |
|
| 67 | + $dimensions = ''; |
|
| 68 | + $sort = ''; |
|
| 69 | + $filters = "ga:pagePath==".$page; |
|
| 70 | + $metrics = "ga:pageviews"; |
|
| 71 | + $realtime = false; |
|
| 72 | + $limit = false; |
|
| 73 | + if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){
|
|
| 74 | + $start_date = date('Y-m-d', strtotime("-6 day"));
|
|
| 75 | + $end_date = date('Y-m-d');
|
|
| 76 | + $dimensions = "ga:date,ga:nthDay"; |
|
| 77 | + }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
|
|
| 78 | + $start_date = date('Y-m-d', strtotime("-13 day"));
|
|
| 79 | + $end_date = date('Y-m-d', strtotime("-7 day"));
|
|
| 80 | + $dimensions = "ga:date,ga:nthDay"; |
|
| 81 | + } |
|
| 82 | + elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
|
|
| 83 | + $start_date = date('Y')."-01-01";
|
|
| 84 | + $end_date = date('Y-m-d');
|
|
| 85 | + $dimensions = "ga:month,ga:nthMonth"; |
|
| 86 | + } |
|
| 87 | + elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
|
|
| 88 | + $start_date = date('Y', strtotime("-1 year"))."-01-01";
|
|
| 89 | + $end_date = date('Y', strtotime("-1 year"))."-12-31";
|
|
| 90 | + $dimensions = "ga:month,ga:nthMonth"; |
|
| 91 | + } |
|
| 92 | + elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
|
|
| 93 | + $start_date = "14daysAgo"; |
|
| 94 | + $end_date = "yesterday"; |
|
| 95 | + $dimensions = "ga:country"; |
|
| 96 | + $sort = "ga:pageviews"; |
|
| 97 | + $limit = 5; |
|
| 98 | + }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){
|
|
| 99 | + $metrics = "rt:activeUsers"; |
|
| 100 | + $realtime = true; |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + # Create a new Gdata call |
|
| 104 | + $gaApi = new GDGoogleAnalyticsStats(); |
|
| 105 | + |
|
| 106 | + # Check if Google sucessfully logged in |
|
| 107 | + if (!$gaApi->checkLogin()){
|
|
| 108 | + echo json_encode(array('error'=>__('Please check Google Analytics Settings','geodirectory')));
|
|
| 109 | + return false; |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + $account = $gaApi->getSingleProfile(); |
|
| 113 | + |
|
| 114 | + if(!isset($account[0]['id'])){
|
|
| 115 | + echo json_encode(array('error'=>__('Please check Google Analytics Settings','geodirectory')));
|
|
| 116 | + return false; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + $account = $account[0]['id']; |
|
| 120 | + |
|
| 121 | + # Set the account to the one requested |
|
| 122 | + $gaApi->setAccount($account); |
|
| 123 | + |
|
| 124 | + |
|
| 125 | + |
|
| 126 | + # Get the metrics needed to build the visits graph; |
|
| 127 | + try {
|
|
| 128 | + $stats = $gaApi->getMetrics($metrics, $start_date, $end_date, $dimensions, $sort, $filters, $limit , $realtime); |
|
| 129 | + } |
|
| 130 | + catch (Exception $e) {
|
|
| 131 | + print 'GA Summary Widget - there was a service error ' . $e->getCode() . ':' . $e->getMessage(); |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + |
|
| 135 | + //print_r($stats); |
|
| 136 | + echo json_encode($stats); |
|
| 137 | + exit; |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | }// end GA function |
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | function geodir_ga_get_token(){
|
| 144 | - $at = get_option('gd_ga_access_token');
|
|
| 145 | - $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at; |
|
| 146 | - $response = wp_remote_get($use_url,array('timeout' => 15));
|
|
| 144 | + $at = get_option('gd_ga_access_token');
|
|
| 145 | + $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at; |
|
| 146 | + $response = wp_remote_get($use_url,array('timeout' => 15));
|
|
| 147 | 147 | |
| 148 | - if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid
|
|
| 148 | + if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid
|
|
| 149 | 149 | |
| 150 | - return $at; |
|
| 151 | - }else{//else get new access token
|
|
| 150 | + return $at; |
|
| 151 | + }else{//else get new access token
|
|
| 152 | 152 | |
| 153 | - $refresh_at = get_option('gd_ga_refresh_token');
|
|
| 154 | - if(!$refresh_at){
|
|
| 155 | - echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit;
|
|
| 156 | - } |
|
| 153 | + $refresh_at = get_option('gd_ga_refresh_token');
|
|
| 154 | + if(!$refresh_at){
|
|
| 155 | + echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit;
|
|
| 156 | + } |
|
| 157 | 157 | |
| 158 | - $rat_url = "https://www.googleapis.com/oauth2/v3/token?"; |
|
| 159 | - $client_id = "client_id=".get_option('geodir_ga_client_id');
|
|
| 160 | - $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
|
|
| 161 | - $refresh_token = "&refresh_token=".$refresh_at; |
|
| 162 | - $grant_type = "&grant_type=refresh_token"; |
|
| 158 | + $rat_url = "https://www.googleapis.com/oauth2/v3/token?"; |
|
| 159 | + $client_id = "client_id=".get_option('geodir_ga_client_id');
|
|
| 160 | + $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
|
|
| 161 | + $refresh_token = "&refresh_token=".$refresh_at; |
|
| 162 | + $grant_type = "&grant_type=refresh_token"; |
|
| 163 | 163 | |
| 164 | - $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type; |
|
| 164 | + $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type; |
|
| 165 | 165 | |
| 166 | - $rat_response = wp_remote_post($rat_url_use,array('timeout' => 15));
|
|
| 167 | - if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) {
|
|
| 168 | - $parts = json_decode($rat_response['body']); |
|
| 166 | + $rat_response = wp_remote_post($rat_url_use,array('timeout' => 15));
|
|
| 167 | + if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) {
|
|
| 168 | + $parts = json_decode($rat_response['body']); |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | - update_option('gd_ga_access_token', $parts->access_token);
|
|
| 172 | - return $parts->access_token; |
|
| 171 | + update_option('gd_ga_access_token', $parts->access_token);
|
|
| 172 | + return $parts->access_token; |
|
| 173 | 173 | |
| 174 | - }else{
|
|
| 175 | - echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit;
|
|
| 176 | - } |
|
| 174 | + }else{
|
|
| 175 | + echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit;
|
|
| 176 | + } |
|
| 177 | 177 | |
| 178 | 178 | |
| 179 | - } |
|
| 179 | + } |
|
| 180 | 180 | |
| 181 | 181 | } |
| 182 | 182 | \ No newline at end of file |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $hours = intval(intval($sec) / 3600); |
| 26 | 26 | |
| 27 | 27 | // add to $hms, with a leading 0 if asked for |
| 28 | - $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; |
|
| 28 | + $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT).':' : $hours.':'; |
|
| 29 | 29 | |
| 30 | 30 | // dividing the total seconds by 60 will give us |
| 31 | 31 | // the number of minutes, but we're interested in |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $minutes = intval(($sec / 60) % 60); |
| 35 | 35 | |
| 36 | 36 | // then add to $hms (with a leading 0 if needed) |
| 37 | - $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; |
|
| 37 | + $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT).':'; |
|
| 38 | 38 | |
| 39 | 39 | // seconds are simple - just divide the total |
| 40 | 40 | // seconds by 60 and keep the remainder |
@@ -70,32 +70,32 @@ discard block |
||
| 70 | 70 | $metrics = "ga:pageviews"; |
| 71 | 71 | $realtime = false; |
| 72 | 72 | $limit = false; |
| 73 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){
|
|
| 73 | + if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'thisweek') {
|
|
| 74 | 74 | $start_date = date('Y-m-d', strtotime("-6 day"));
|
| 75 | 75 | $end_date = date('Y-m-d');
|
| 76 | 76 | $dimensions = "ga:date,ga:nthDay"; |
| 77 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
|
|
| 77 | + }elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'lastweek') {
|
|
| 78 | 78 | $start_date = date('Y-m-d', strtotime("-13 day"));
|
| 79 | 79 | $end_date = date('Y-m-d', strtotime("-7 day"));
|
| 80 | 80 | $dimensions = "ga:date,ga:nthDay"; |
| 81 | 81 | } |
| 82 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
|
|
| 82 | + elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'thisyear') {
|
|
| 83 | 83 | $start_date = date('Y')."-01-01";
|
| 84 | 84 | $end_date = date('Y-m-d');
|
| 85 | 85 | $dimensions = "ga:month,ga:nthMonth"; |
| 86 | 86 | } |
| 87 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
|
|
| 87 | + elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'lastyear') {
|
|
| 88 | 88 | $start_date = date('Y', strtotime("-1 year"))."-01-01";
|
| 89 | 89 | $end_date = date('Y', strtotime("-1 year"))."-12-31";
|
| 90 | 90 | $dimensions = "ga:month,ga:nthMonth"; |
| 91 | 91 | } |
| 92 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
|
|
| 92 | + elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'country') {
|
|
| 93 | 93 | $start_date = "14daysAgo"; |
| 94 | 94 | $end_date = "yesterday"; |
| 95 | 95 | $dimensions = "ga:country"; |
| 96 | 96 | $sort = "ga:pageviews"; |
| 97 | - $limit = 5; |
|
| 98 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){
|
|
| 97 | + $limit = 5; |
|
| 98 | + }elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'realtime') {
|
|
| 99 | 99 | $metrics = "rt:activeUsers"; |
| 100 | 100 | $realtime = true; |
| 101 | 101 | } |
@@ -104,15 +104,15 @@ discard block |
||
| 104 | 104 | $gaApi = new GDGoogleAnalyticsStats(); |
| 105 | 105 | |
| 106 | 106 | # Check if Google sucessfully logged in |
| 107 | - if (!$gaApi->checkLogin()){
|
|
| 108 | - echo json_encode(array('error'=>__('Please check Google Analytics Settings','geodirectory')));
|
|
| 107 | + if (!$gaApi->checkLogin()) {
|
|
| 108 | + echo json_encode(array('error'=>__('Please check Google Analytics Settings', 'geodirectory')));
|
|
| 109 | 109 | return false; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $account = $gaApi->getSingleProfile(); |
| 113 | 113 | |
| 114 | - if(!isset($account[0]['id'])){
|
|
| 115 | - echo json_encode(array('error'=>__('Please check Google Analytics Settings','geodirectory')));
|
|
| 114 | + if (!isset($account[0]['id'])) {
|
|
| 115 | + echo json_encode(array('error'=>__('Please check Google Analytics Settings', 'geodirectory')));
|
|
| 116 | 116 | return false; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | # Get the metrics needed to build the visits graph; |
| 127 | 127 | try {
|
| 128 | - $stats = $gaApi->getMetrics($metrics, $start_date, $end_date, $dimensions, $sort, $filters, $limit , $realtime); |
|
| 128 | + $stats = $gaApi->getMetrics($metrics, $start_date, $end_date, $dimensions, $sort, $filters, $limit, $realtime); |
|
| 129 | 129 | } |
| 130 | 130 | catch (Exception $e) {
|
| 131 | - print 'GA Summary Widget - there was a service error ' . $e->getCode() . ':' . $e->getMessage(); |
|
| 131 | + print 'GA Summary Widget - there was a service error '.$e->getCode().':'.$e->getMessage(); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
@@ -140,19 +140,19 @@ discard block |
||
| 140 | 140 | }// end GA function |
| 141 | 141 | |
| 142 | 142 | |
| 143 | -function geodir_ga_get_token(){
|
|
| 143 | +function geodir_ga_get_token() {
|
|
| 144 | 144 | $at = get_option('gd_ga_access_token');
|
| 145 | 145 | $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at; |
| 146 | - $response = wp_remote_get($use_url,array('timeout' => 15));
|
|
| 146 | + $response = wp_remote_get($use_url, array('timeout' => 15));
|
|
| 147 | 147 | |
| 148 | - if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid
|
|
| 148 | + if (!empty($response['response']['code']) && $response['response']['code'] == 200) {//access token is valid
|
|
| 149 | 149 | |
| 150 | 150 | return $at; |
| 151 | - }else{//else get new access token
|
|
| 151 | + } else {//else get new access token
|
|
| 152 | 152 | |
| 153 | 153 | $refresh_at = get_option('gd_ga_refresh_token');
|
| 154 | - if(!$refresh_at){
|
|
| 155 | - echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit;
|
|
| 154 | + if (!$refresh_at) {
|
|
| 155 | + echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory'))); exit;
|
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $rat_url = "https://www.googleapis.com/oauth2/v3/token?"; |
@@ -163,16 +163,16 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type; |
| 165 | 165 | |
| 166 | - $rat_response = wp_remote_post($rat_url_use,array('timeout' => 15));
|
|
| 167 | - if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) {
|
|
| 166 | + $rat_response = wp_remote_post($rat_url_use, array('timeout' => 15));
|
|
| 167 | + if (!empty($rat_response['response']['code']) && $rat_response['response']['code'] == 200) {
|
|
| 168 | 168 | $parts = json_decode($rat_response['body']); |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | update_option('gd_ga_access_token', $parts->access_token);
|
| 172 | 172 | return $parts->access_token; |
| 173 | 173 | |
| 174 | - }else{
|
|
| 175 | - echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit;
|
|
| 174 | + } else {
|
|
| 175 | + echo json_encode(array('error'=>__('Login failed', 'geodirectory'))); exit;
|
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
@@ -74,28 +74,25 @@ discard block |
||
| 74 | 74 | $start_date = date('Y-m-d', strtotime("-6 day"));
|
| 75 | 75 | $end_date = date('Y-m-d');
|
| 76 | 76 | $dimensions = "ga:date,ga:nthDay"; |
| 77 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
|
|
| 77 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
|
|
| 78 | 78 | $start_date = date('Y-m-d', strtotime("-13 day"));
|
| 79 | 79 | $end_date = date('Y-m-d', strtotime("-7 day"));
|
| 80 | 80 | $dimensions = "ga:date,ga:nthDay"; |
| 81 | - } |
|
| 82 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
|
|
| 81 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
|
|
| 83 | 82 | $start_date = date('Y')."-01-01";
|
| 84 | 83 | $end_date = date('Y-m-d');
|
| 85 | 84 | $dimensions = "ga:month,ga:nthMonth"; |
| 86 | - } |
|
| 87 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
|
|
| 85 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
|
|
| 88 | 86 | $start_date = date('Y', strtotime("-1 year"))."-01-01";
|
| 89 | 87 | $end_date = date('Y', strtotime("-1 year"))."-12-31";
|
| 90 | 88 | $dimensions = "ga:month,ga:nthMonth"; |
| 91 | - } |
|
| 92 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
|
|
| 89 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
|
|
| 93 | 90 | $start_date = "14daysAgo"; |
| 94 | 91 | $end_date = "yesterday"; |
| 95 | 92 | $dimensions = "ga:country"; |
| 96 | 93 | $sort = "ga:pageviews"; |
| 97 | 94 | $limit = 5; |
| 98 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){
|
|
| 95 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){
|
|
| 99 | 96 | $metrics = "rt:activeUsers"; |
| 100 | 97 | $realtime = true; |
| 101 | 98 | } |
@@ -126,8 +123,7 @@ discard block |
||
| 126 | 123 | # Get the metrics needed to build the visits graph; |
| 127 | 124 | try {
|
| 128 | 125 | $stats = $gaApi->getMetrics($metrics, $start_date, $end_date, $dimensions, $sort, $filters, $limit , $realtime); |
| 129 | - } |
|
| 130 | - catch (Exception $e) {
|
|
| 126 | + } catch (Exception $e) {
|
|
| 131 | 127 | print 'GA Summary Widget - there was a service error ' . $e->getCode() . ':' . $e->getMessage(); |
| 132 | 128 | } |
| 133 | 129 | |
@@ -148,7 +144,7 @@ discard block |
||
| 148 | 144 | if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid
|
| 149 | 145 | |
| 150 | 146 | return $at; |
| 151 | - }else{//else get new access token
|
|
| 147 | + } else{//else get new access token
|
|
| 152 | 148 | |
| 153 | 149 | $refresh_at = get_option('gd_ga_refresh_token');
|
| 154 | 150 | if(!$refresh_at){
|
@@ -171,7 +167,7 @@ discard block |
||
| 171 | 167 | update_option('gd_ga_access_token', $parts->access_token);
|
| 172 | 168 | return $parts->access_token; |
| 173 | 169 | |
| 174 | - }else{
|
|
| 170 | + } else{
|
|
| 175 | 171 | echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit;
|
| 176 | 172 | } |
| 177 | 173 | |
@@ -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 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * Include WordPress core file so we can use core functions to check for active plugins. |
| 36 | 36 | */ |
| 37 | - include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
| 37 | + include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
| 38 | 38 | |
| 39 | 39 | if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
|
| 40 | 40 | deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
|
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | * @global string $plugin_file_name Base file name. 'geodirectory/geodirectory.php'. |
| 69 | 69 | */ |
| 70 | 70 | global $wpdb, $plugin_prefix, $geodir_addon_list, $plugin_file_name; |
| 71 | -$plugin_prefix = $wpdb->prefix . 'geodir_'; |
|
| 72 | -$plugin_file_name = basename(plugin_dir_path(__FILE__)) . '/' . basename(__FILE__); |
|
| 71 | +$plugin_prefix = $wpdb->prefix.'geodir_'; |
|
| 72 | +$plugin_file_name = basename(plugin_dir_path(__FILE__)).'/'.basename(__FILE__); |
|
| 73 | 73 | |
| 74 | 74 | /* |
| 75 | 75 | * This will store the cached post custom fields per package for each page load so not to run for each listing. |
@@ -84,24 +84,24 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Define constants |
| 86 | 86 | */ |
| 87 | -if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
|
| 87 | +if (!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
| 88 | 88 | |
| 89 | 89 | /* |
| 90 | 90 | * Declare database table names. All since version 1.0.0 |
| 91 | 91 | */ |
| 92 | 92 | |
| 93 | 93 | /** Define the database name for the countries table. */ |
| 94 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
|
|
| 94 | +if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix.'countries');
|
|
| 95 | 95 | /** Define the database name for the custom fields table. */ |
| 96 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
|
|
| 96 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix.'custom_fields');
|
|
| 97 | 97 | /** Define the database name for the icons table. */ |
| 98 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
|
|
| 98 | +if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix.'post_icon');
|
|
| 99 | 99 | /** Define the database name for the attachments table. */ |
| 100 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
|
|
| 100 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix.'attachments');
|
|
| 101 | 101 | /** Define the database name for the review table. */ |
| 102 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
|
|
| 102 | +if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix.'post_review');
|
|
| 103 | 103 | /** Define the database name for the custom sort fields table. */ |
| 104 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
|
|
| 104 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix.'custom_sort_fields');
|
|
| 105 | 105 | |
| 106 | 106 | /* |
| 107 | 107 | * Define our Google Analytic app settings |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if (!defined('GEODIR_GA_CLIENTID')) define('GEODIR_GA_CLIENTID', '687912069872-sdpsjssrdt7t3ao1dnv1ib71hkckbt5s.apps.googleusercontent.com');
|
| 110 | 110 | if (!defined('GEODIR_GA_CLIENTSECRET')) define('GEODIR_GA_CLIENTSECRET', 'yBVkDpqJ1B9nAETHy738Zn8C'); //don't worry - this don't need to be secret in our case
|
| 111 | 111 | if (!defined('GEODIR_GA_REDIRECT')) define('GEODIR_GA_REDIRECT', 'urn:ietf:wg:oauth:2.0:oob');
|
| 112 | -if (!defined('GEODIR_GA_SCOPE')) define('GEODIR_GA_SCOPE', 'https://www.googleapis.com/auth/analytics');//.readonly
|
|
| 112 | +if (!defined('GEODIR_GA_SCOPE')) define('GEODIR_GA_SCOPE', 'https://www.googleapis.com/auth/analytics'); //.readonly
|
|
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | /* |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
|
| 119 | 119 | |
| 120 | 120 | // Load geodirectory plugin textdomain. |
| 121 | -add_action( 'init', 'geodir_load_textdomain' ); |
|
| 121 | +add_action('init', 'geodir_load_textdomain');
|
|
| 122 | 122 | |
| 123 | 123 | /* |
| 124 | 124 | * A function to log GD errors no matter the type given. |
@@ -129,18 +129,18 @@ discard block |
||
| 129 | 129 | * @param mixed $log The thing that should be logged. |
| 130 | 130 | * @package GeoDirectory |
| 131 | 131 | */ |
| 132 | -function geodir_error_log($log){
|
|
| 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 ) ); |
|
| 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 | 142 | } else {
|
| 143 | - error_log( $log ); |
|
| 143 | + error_log($log); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | /* |
| 180 | 180 | * Admin init + activation hooks |
| 181 | 181 | */ |
| 182 | -if (is_admin() || defined( 'GD_TESTING_MODE' )) {
|
|
| 182 | +if (is_admin() || defined('GD_TESTING_MODE')) {
|
|
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | 185 | * Include functions used in admin area only. |
@@ -216,14 +216,14 @@ discard block |
||
| 216 | 216 | * |
| 217 | 217 | * @since 1.0.0 |
| 218 | 218 | */ |
| 219 | - require_once(geodir_plugin_path() . '/upgrade.php'); |
|
| 219 | + require_once(geodir_plugin_path().'/upgrade.php'); |
|
| 220 | 220 | if (get_option('geodir_installed') != 1) {
|
| 221 | 221 | /** |
| 222 | 222 | * Define language constants, here as they are not loaded yet. |
| 223 | 223 | * |
| 224 | 224 | * @since 1.0.0 |
| 225 | 225 | */ |
| 226 | - require_once(geodir_plugin_path() . '/language.php'); |
|
| 226 | + require_once(geodir_plugin_path().'/language.php'); |
|
| 227 | 227 | /** |
| 228 | 228 | * Include the plugin install file that sets up the databases and any options on first run. |
| 229 | 229 | * |
@@ -240,13 +240,13 @@ discard block |
||
| 240 | 240 | * @since 1.5.6 |
| 241 | 241 | */ |
| 242 | 242 | global $pagenow; |
| 243 | - if ( 'plugins.php' === $pagenow ) |
|
| 243 | + if ('plugins.php' === $pagenow)
|
|
| 244 | 244 | {
|
| 245 | 245 | // Better update message |
| 246 | - $file = basename( __FILE__ ); |
|
| 247 | - $folder = basename( dirname( __FILE__ ) ); |
|
| 246 | + $file = basename(__FILE__); |
|
| 247 | + $folder = basename(dirname(__FILE__)); |
|
| 248 | 248 | $hook = "in_plugin_update_message-{$folder}/{$file}";
|
| 249 | - add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 249 | + add_action($hook, 'geodire_admin_upgrade_notice', 20, 2); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | } |
@@ -79,43 +79,71 @@ |
||
| 79 | 79 | /** |
| 80 | 80 | * Do not store any revisions (except the one autosave per post). |
| 81 | 81 | */ |
| 82 | -if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 0);
|
|
| 82 | +if (!defined('WP_POST_REVISIONS')) { |
|
| 83 | + define('WP_POST_REVISIONS', 0); |
|
| 84 | +} |
|
| 83 | 85 | |
| 84 | 86 | /** |
| 85 | 87 | * Define constants |
| 86 | 88 | */ |
| 87 | -if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
|
| 89 | +if(!defined('GEODIRECTORY_PLUGIN_DIR')) { |
|
| 90 | + define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ )); |
|
| 91 | +} |
|
| 88 | 92 | |
| 89 | 93 | /* |
| 90 | 94 | * Declare database table names. All since version 1.0.0 |
| 91 | 95 | */ |
| 92 | 96 | |
| 93 | 97 | /** Define the database name for the countries table. */ |
| 94 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
|
|
| 98 | +if (!defined('GEODIR_COUNTRIES_TABLE')) { |
|
| 99 | + define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries'); |
|
| 100 | +} |
|
| 95 | 101 | /** Define the database name for the custom fields table. */ |
| 96 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
|
|
| 102 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) { |
|
| 103 | + define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields'); |
|
| 104 | +} |
|
| 97 | 105 | /** Define the database name for the icons table. */ |
| 98 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
|
|
| 106 | +if (!defined('GEODIR_ICON_TABLE')) { |
|
| 107 | + define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon'); |
|
| 108 | +} |
|
| 99 | 109 | /** Define the database name for the attachments table. */ |
| 100 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
|
|
| 110 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) { |
|
| 111 | + define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments'); |
|
| 112 | +} |
|
| 101 | 113 | /** Define the database name for the review table. */ |
| 102 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
|
|
| 114 | +if (!defined('GEODIR_REVIEW_TABLE')) { |
|
| 115 | + define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review'); |
|
| 116 | +} |
|
| 103 | 117 | /** Define the database name for the custom sort fields table. */ |
| 104 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
|
|
| 118 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) { |
|
| 119 | + define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields'); |
|
| 120 | +} |
|
| 105 | 121 | |
| 106 | 122 | /* |
| 107 | 123 | * Define our Google Analytic app settings |
| 108 | 124 | */ |
| 109 | -if (!defined('GEODIR_GA_CLIENTID')) define('GEODIR_GA_CLIENTID', '687912069872-sdpsjssrdt7t3ao1dnv1ib71hkckbt5s.apps.googleusercontent.com');
|
|
| 110 | -if (!defined('GEODIR_GA_CLIENTSECRET')) define('GEODIR_GA_CLIENTSECRET', 'yBVkDpqJ1B9nAETHy738Zn8C'); //don't worry - this don't need to be secret in our case
|
|
| 111 | -if (!defined('GEODIR_GA_REDIRECT')) define('GEODIR_GA_REDIRECT', 'urn:ietf:wg:oauth:2.0:oob');
|
|
| 112 | -if (!defined('GEODIR_GA_SCOPE')) define('GEODIR_GA_SCOPE', 'https://www.googleapis.com/auth/analytics');//.readonly
|
|
| 125 | +if (!defined('GEODIR_GA_CLIENTID')) { |
|
| 126 | + define('GEODIR_GA_CLIENTID', '687912069872-sdpsjssrdt7t3ao1dnv1ib71hkckbt5s.apps.googleusercontent.com'); |
|
| 127 | +} |
|
| 128 | +if (!defined('GEODIR_GA_CLIENTSECRET')) { |
|
| 129 | + define('GEODIR_GA_CLIENTSECRET', 'yBVkDpqJ1B9nAETHy738Zn8C'); |
|
| 130 | +} |
|
| 131 | +//don't worry - this don't need to be secret in our case |
|
| 132 | +if (!defined('GEODIR_GA_REDIRECT')) { |
|
| 133 | + define('GEODIR_GA_REDIRECT', 'urn:ietf:wg:oauth:2.0:oob'); |
|
| 134 | +} |
|
| 135 | +if (!defined('GEODIR_GA_SCOPE')) { |
|
| 136 | + define('GEODIR_GA_SCOPE', 'https://www.googleapis.com/auth/analytics'); |
|
| 137 | +} |
|
| 138 | +//.readonly |
|
| 113 | 139 | |
| 114 | 140 | |
| 115 | 141 | /* |
| 116 | 142 | * Localisation items. |
| 117 | 143 | */ |
| 118 | -if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
|
|
| 144 | +if (!defined('GEODIRECTORY_TEXTDOMAIN')) { |
|
| 145 | + define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
|
| 146 | +} |
|
| 119 | 147 | |
| 120 | 148 | // Load geodirectory plugin textdomain. |
| 121 | 149 | add_action( 'init', 'geodir_load_textdomain' ); |
@@ -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 | } |
@@ -38,21 +38,21 @@ discard block |
||
| 38 | 38 | $is_detail_page = false; |
| 39 | 39 | $geodir_map_name = geodir_map_name(); |
| 40 | 40 | |
| 41 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 41 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
|
|
| 42 | 42 | $is_detail_page = true; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | wp_enqueue_script('jquery');
|
| 46 | 46 | |
| 47 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 47 | + wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 48 | 48 | wp_enqueue_script('geodirectory-script');
|
| 49 | 49 | |
| 50 | 50 | $geodir_vars_data = array( |
| 51 | 51 | 'siteurl' => get_option('siteurl'),
|
| 52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
| 53 | - 'geodir_lazy_load' => get_option('geodir_lazy_load',1),
|
|
| 53 | + 'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
|
|
| 54 | 54 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
| 55 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 55 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
|
|
| 56 | 56 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
| 57 | 57 | ); |
| 58 | 58 | |
@@ -73,24 +73,24 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * } |
| 75 | 75 | */ |
| 76 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 76 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
|
|
| 77 | 77 | |
| 78 | 78 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
| 79 | 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');}
|
|
| 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 | 82 | |
| 83 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 83 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 84 | 84 | wp_enqueue_script('geodirectory-lightbox-jquery');
|
| 85 | 85 | |
| 86 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 86 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 87 | 87 | if ($is_detail_page) {
|
| 88 | 88 | wp_enqueue_script('geodirectory-jquery-simplemodal');
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 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(); |
|
| 92 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
| 93 | + $map_key = "&key=".geodir_get_map_api_key(); |
|
| 94 | 94 | /** |
| 95 | 95 | * Filter the variables that are added to the end of the google maps script call. |
| 96 | 96 | * |
@@ -100,48 +100,48 @@ discard block |
||
| 100 | 100 | * @param string $var The string to filter, default is empty string. |
| 101 | 101 | */ |
| 102 | 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);
|
|
| 103 | + wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
|
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | if ($geodir_map_name == 'osm') {
|
| 107 | 107 | // Leaflet OpenStreetMap |
| 108 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 108 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 109 | 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);
|
|
| 111 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 112 | 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);
|
|
| 114 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
|
|
| 115 | 115 | wp_enqueue_script('geodirectory-leaflet-geo-script');
|
| 116 | 116 | |
| 117 | 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);
|
|
| 118 | + wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 119 | 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);
|
|
| 121 | + wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
|
|
| 122 | 122 | wp_enqueue_script('geodirectory-leaflet-routing-script');
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 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);
|
|
| 127 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 128 | 128 | wp_enqueue_script('geodirectory-goMap-script');
|
| 129 | 129 | |
| 130 | 130 | |
| 131 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 131 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 132 | 132 | wp_enqueue_script('chosen');
|
| 133 | 133 | |
| 134 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 134 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 135 | 135 | wp_enqueue_script('geodirectory-choose-ajax');
|
| 136 | 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);
|
|
| 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 | 138 | |
| 139 | 139 | if (is_page() && geodir_is_page('add-listing')) {
|
| 140 | 140 | // SCRIPT FOR UPLOAD |
| 141 | 141 | wp_enqueue_script('plupload-all');
|
| 142 | 142 | wp_enqueue_script('jquery-ui-sortable');
|
| 143 | 143 | |
| 144 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 144 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 145 | 145 | wp_enqueue_script('geodirectory-plupload-script');
|
| 146 | 146 | // SCRIPT FOR UPLOAD END |
| 147 | 147 | |
@@ -188,27 +188,27 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
| 190 | 190 | |
| 191 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 191 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 192 | 192 | } // End if for add place page |
| 193 | 193 | |
| 194 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 194 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 195 | 195 | if ($is_detail_page) {
|
| 196 | 196 | wp_enqueue_script('geodirectory-post-custom-js');
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // font awesome rating script |
| 200 | 200 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
| 201 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 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');
|
| 203 | 203 | } else { // default rating script
|
| 204 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 204 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 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);
|
|
| 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 | 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);
|
|
| 211 | + wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 212 | 212 | wp_enqueue_script('google-geometa');
|
| 213 | 213 | } |
| 214 | 214 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | function geodir_header_scripts() |
| 225 | 225 | {
|
| 226 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 226 | + echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
|
|
| 227 | 227 | echo stripslashes(get_option('geodir_header_scripts'));
|
| 228 | 228 | } |
| 229 | 229 | |
@@ -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(){
|
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 249 | 249 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 250 | 250 | |
| 251 | - ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
|
|
| 251 | + ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
|
|
| 252 | 252 | ga('send', 'pageview');
|
| 253 | 253 | |
| 254 | 254 | </script> |
| 255 | 255 | |
| 256 | 256 | <?php |
| 257 | - }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 257 | + }elseif (get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
|
|
| 258 | 258 | echo stripslashes(get_option('geodir_ga_tracking_code'));
|
| 259 | 259 | } |
| 260 | 260 | |
@@ -265,7 +265,7 @@ discard block |
||
| 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'] ) ) {
|
|
| 268 | + if (preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
|
|
| 269 | 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 | 270 | } |
| 271 | 271 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | function geodir_add_async_forscript($url) |
| 283 | 283 | {
|
| 284 | - if (strpos($url, '#asyncload')===false) |
|
| 284 | + if (strpos($url, '#asyncload') === false) |
|
| 285 | 285 | return $url; |
| 286 | 286 | else if (is_admin()) |
| 287 | 287 | return str_replace('#asyncload', '', $url);
|
@@ -299,12 +299,12 @@ 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);
|
|
| 302 | + wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 303 | 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);
|
|
| 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);
|
|
| 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 | 308 | wp_enqueue_style('geodirectory-frontend-rtl-style');
|
| 309 | 309 | } |
| 310 | 310 | |
@@ -378,18 +378,18 @@ discard block |
||
| 378 | 378 | $term_id = get_queried_object_id(); |
| 379 | 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'); |
|
| 381 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
|
|
| 382 | + $term = get_term($term_id, $post_type.'category'); |
|
| 383 | 383 | } |
| 384 | 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 | 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'); |
|
| 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 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | if ($max_page > 1 || $always_show) {
|
| 402 | 402 | // Extra pagination info |
| 403 | 403 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
| 404 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 404 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
| 405 | 405 | $end_no = min($paged * $posts_per_page, $numposts); |
| 406 | 406 | |
| 407 | 407 | if ($geodir_pagination_more_info != '') {
|
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | } else {
|
| 412 | 412 | $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
| 413 | 413 | } |
| 414 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 414 | + $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>'; |
|
| 415 | 415 | /** |
| 416 | 416 | * Adds an extra pagination info above/under pagination. |
| 417 | 417 | * |
@@ -427,15 +427,15 @@ discard block |
||
| 427 | 427 | $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
| 428 | 428 | |
| 429 | 429 | if ($geodir_pagination_more_info == 'before') {
|
| 430 | - $before = $before . $pagination_info; |
|
| 430 | + $before = $before.$pagination_info; |
|
| 431 | 431 | } else if ($geodir_pagination_more_info == 'after') {
|
| 432 | - $after = $pagination_info . $after; |
|
| 432 | + $after = $pagination_info.$after; |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | echo "$before <div class='Navi gd-navi'>"; |
| 437 | 437 | if ($paged >= ($pages_to_show - 1)) {
|
| 438 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 438 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>';
|
|
| 439 | 439 | } |
| 440 | 440 | previous_posts_link($prelabel); |
| 441 | 441 | for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
@@ -443,13 +443,13 @@ discard block |
||
| 443 | 443 | if ($i == $paged) {
|
| 444 | 444 | echo "<strong class='on'>$i</strong>"; |
| 445 | 445 | } else {
|
| 446 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 446 | + echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> ';
|
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | next_posts_link($nxtlabel, $max_page); |
| 451 | 451 | if (($paged + $half_pages_to_show) < ($max_page)) {
|
| 452 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 452 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>';
|
|
| 453 | 453 | } |
| 454 | 454 | echo "</div> $after"; |
| 455 | 455 | } |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | jQuery(function ($) {
|
| 488 | 488 | $("#distance_slider").slider({
|
| 489 | 489 | range: true, |
| 490 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 490 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 491 | 491 | min: 0, |
| 492 | 492 | max: <?php echo $dist; ?>, |
| 493 | 493 | step: <?php echo $dist_dif; ?>, |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | |
| 553 | 553 | |
| 554 | 554 | <script type="text/javascript"> |
| 555 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
| 555 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
| 556 | 556 | var latlng; |
| 557 | 557 | var address; |
| 558 | 558 | var dist = 0; |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | var $form = jQuery(this).closest('form');
|
| 569 | 569 | |
| 570 | 570 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
|
| 571 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
|
|
| 571 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
|
|
| 572 | 572 | |
| 573 | 573 | // Disable location based search for disabled location post type. |
| 574 | 574 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
|
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
|
|
| 585 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
|
|
| 586 | 586 | geodir_setsearch($form); |
| 587 | 587 | } else {
|
| 588 | 588 | jQuery(".snear", $form).val('');
|
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | }); |
| 601 | 601 | |
| 602 | 602 | function geodir_setsearch($form) {
|
| 603 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
|
|
| 603 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
|
|
| 604 | 604 | geocodeAddress($form); |
| 605 | 605 | } |
| 606 | 606 | |
@@ -619,15 +619,15 @@ discard block |
||
| 619 | 619 | // Call the geocode function |
| 620 | 620 | Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
| 621 | 621 | |
| 622 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 623 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 622 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 623 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 624 | 624 | jQuery(".snear", $form).val('');
|
| 625 | 625 | } |
| 626 | 626 | jQuery($form).submit(); |
| 627 | 627 | } else {
|
| 628 | 628 | var address = jQuery(".snear", $form).val();
|
| 629 | 629 | |
| 630 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
|
|
| 630 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
|
|
| 631 | 631 | initialise2(); |
| 632 | 632 | } else {
|
| 633 | 633 | <?php |
@@ -640,12 +640,12 @@ discard block |
||
| 640 | 640 | $near_add2 = apply_filters('geodir_search_near_addition', '');
|
| 641 | 641 | ?> |
| 642 | 642 | if (window.gdMaps === 'google') {
|
| 643 | - Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
|
|
| 643 | + Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
|
|
| 644 | 644 | function (results, status) {
|
| 645 | 645 | if (status == google.maps.GeocoderStatus.OK) {
|
| 646 | 646 | updateSearchPosition(results[0].geometry.location, $form); |
| 647 | 647 | } else {
|
| 648 | - alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
|
|
| 648 | + alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
|
|
| 649 | 649 | } |
| 650 | 650 | }); |
| 651 | 651 | } else if (window.gdMaps === 'osm') {
|
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
|
| 655 | 655 | updateSearchPosition(geo, $form); |
| 656 | 656 | } else {
|
| 657 | - alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
|
|
| 657 | + alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
|
|
| 658 | 658 | } |
| 659 | 659 | }); |
| 660 | 660 | } else {
|
@@ -700,19 +700,19 @@ discard block |
||
| 700 | 700 | var msg; |
| 701 | 701 | switch (err.code) {
|
| 702 | 702 | case err.UNKNOWN_ERROR: |
| 703 | - msg = "<?php _e('Unable to find your location','geodirectory');?>";
|
|
| 703 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
|
|
| 704 | 704 | break; |
| 705 | 705 | case err.PERMISSION_DENINED: |
| 706 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
|
|
| 706 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
|
|
| 707 | 707 | break; |
| 708 | 708 | case err.POSITION_UNAVAILABLE: |
| 709 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
|
|
| 709 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
|
|
| 710 | 710 | break; |
| 711 | 711 | case err.BREAK: |
| 712 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
|
|
| 712 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
|
|
| 713 | 713 | break; |
| 714 | 714 | default: |
| 715 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
|
|
| 715 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
|
|
| 716 | 716 | } |
| 717 | 717 | jQuery('#info').html(msg);
|
| 718 | 718 | } |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | * @param object $post The post object. |
| 752 | 752 | * @param string $link The link to the post. |
| 753 | 753 | */ |
| 754 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 754 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link);
|
|
| 755 | 755 | break; |
| 756 | 756 | case 'new' : |
| 757 | 757 | /** |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | * @param object $post The post object. |
| 762 | 762 | * @param string $link The link to the post. |
| 763 | 763 | */ |
| 764 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 764 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link);
|
|
| 765 | 765 | break; |
| 766 | 766 | |
| 767 | 767 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | </script> |
| 255 | 255 | |
| 256 | 256 | <?php |
| 257 | - }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 257 | + } elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 258 | 258 | echo stripslashes(get_option('geodir_ga_tracking_code'));
|
| 259 | 259 | } |
| 260 | 260 | |
@@ -281,13 +281,14 @@ 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";
|
|
| 290 | -} |
|
| 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 | + } |
|
| 291 | + } |
|
| 291 | 292 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
|
| 292 | 293 | |
| 293 | 294 | /** |
@@ -354,8 +355,10 @@ discard block |
||
| 354 | 355 | |
| 355 | 356 | $half_pages_to_show = round($pages_to_show / 2); |
| 356 | 357 | |
| 357 | - if (geodir_is_page('home')) // dont apply default pagination for geodirectory home page.
|
|
| 358 | - return; |
|
| 358 | + if (geodir_is_page('home')) { |
|
| 359 | + // dont apply default pagination for geodirectory home page. |
|
| 360 | + return; |
|
| 361 | + } |
|
| 359 | 362 | |
| 360 | 363 | if (!is_single()) {
|
| 361 | 364 | if (function_exists('geodir_location_geo_home_link')) {
|
@@ -475,11 +478,21 @@ discard block |
||
| 475 | 478 | } |
| 476 | 479 | $dist_dif = 1000; |
| 477 | 480 | |
| 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; |
|
| 481 | + if ($dist <= 5000) { |
|
| 482 | + $dist_dif = 500; |
|
| 483 | + } |
|
| 484 | + if ($dist <= 1000) { |
|
| 485 | + $dist_dif = 100; |
|
| 486 | + } |
|
| 487 | + if ($dist <= 500) { |
|
| 488 | + $dist_dif = 50; |
|
| 489 | + } |
|
| 490 | + if ($dist <= 100) { |
|
| 491 | + $dist_dif = 10; |
|
| 492 | + } |
|
| 493 | + if ($dist <= 50) { |
|
| 494 | + $dist_dif = 5; |
|
| 495 | + } |
|
| 483 | 496 | |
| 484 | 497 | ?> |
| 485 | 498 | <script type="text/javascript"> |
@@ -541,18 +554,23 @@ discard block |
||
| 541 | 554 | {
|
| 542 | 555 | |
| 543 | 556 | $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');
|
|
| 557 | + if (get_option('geodir_search_field_default_text')) { |
|
| 558 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
| 559 | + } |
|
| 546 | 560 | |
| 547 | 561 | $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');
|
|
| 562 | + if (get_option('geodir_near_field_default_text')) { |
|
| 563 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
| 564 | + } |
|
| 550 | 565 | |
| 551 | 566 | ?> |
| 552 | 567 | |
| 553 | 568 | |
| 554 | 569 | <script type="text/javascript"> |
| 555 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
| 570 | + var default_location = '<?php if($search_location = geodir_get_default_location()) { |
|
| 571 | + echo $search_location->city ; |
|
| 572 | +} |
|
| 573 | +?>'; |
|
| 556 | 574 | var latlng; |
| 557 | 575 | var address; |
| 558 | 576 | var dist = 0; |
@@ -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 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @global object $wpdb WordPress Database object. |
| 19 | 19 | * @global string $dummy_image_path The dummy image path. |
| 20 | 20 | */ |
| 21 | -function geodir_dummy_data_taxonomies($post_type,$category_array) { |
|
| 21 | +function geodir_dummy_data_taxonomies($post_type, $category_array) { |
|
| 22 | 22 | global $wpdb, $dummy_image_path; |
| 23 | 23 | |
| 24 | 24 | |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | if (geodir_dummy_folder_exists()) |
| 46 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 46 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon"; |
|
| 47 | 47 | else |
| 48 | 48 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
| 49 | 49 | |
| 50 | 50 | $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
| 51 | 51 | |
| 52 | 52 | $catname = str_replace(' ', '_', $catname); |
| 53 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 53 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png"); |
|
| 54 | 54 | |
| 55 | 55 | if (empty($uploaded['error'])) { |
| 56 | 56 | $new_path = $uploaded['file']; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $wp_filetype = wp_check_filetype(basename($new_path), null); |
| 61 | 61 | |
| 62 | 62 | $attachment = array( |
| 63 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 63 | + 'guid' => $uploads['baseurl'].'/'.basename($new_path), |
|
| 64 | 64 | 'post_mime_type' => $wp_filetype['type'], |
| 65 | 65 | 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
| 66 | 66 | 'post_content' => '', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // you must first include the image.php file |
| 72 | 72 | // for the function wp_generate_attachment_metadata() to work |
| 73 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 73 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
| 74 | 74 | $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
| 75 | 75 | wp_update_attachment_metadata($attach_id, $attach_data); |
| 76 | 76 | |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | $last_catid = wp_insert_term($catname, $post_type.'category'); |
| 88 | 88 | |
| 89 | 89 | if (geodir_dummy_folder_exists()) |
| 90 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 90 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon"; |
|
| 91 | 91 | else |
| 92 | 92 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
| 93 | 93 | |
| 94 | 94 | $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
| 95 | 95 | |
| 96 | 96 | $catname = str_replace(' ', '_', $catname); |
| 97 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 97 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png"); |
|
| 98 | 98 | |
| 99 | 99 | if (empty($uploaded['error'])) { |
| 100 | 100 | $new_path = $uploaded['file']; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $wp_filetype = wp_check_filetype(basename($new_path), null); |
| 105 | 105 | |
| 106 | 106 | $attachment = array( |
| 107 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 107 | + 'guid' => $uploads['baseurl'].'/'.basename($new_path), |
|
| 108 | 108 | 'post_mime_type' => $wp_filetype['type'], |
| 109 | 109 | 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
| 110 | 110 | 'post_content' => '', |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | // you must first include the image.php file |
| 118 | 118 | // for the function wp_generate_attachment_metadata() to work |
| 119 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 119 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
| 120 | 120 | $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
| 121 | 121 | wp_update_attachment_metadata($attach_id, $attach_data); |
| 122 | 122 | |
@@ -130,18 +130,18 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | -function geodir_dummy_data_types(){ |
|
| 133 | +function geodir_dummy_data_types() { |
|
| 134 | 134 | return array( |
| 135 | 135 | 'standard_places' => array( |
| 136 | - 'name'=>__('Default','geodirectory'), |
|
| 136 | + 'name'=>__('Default', 'geodirectory'), |
|
| 137 | 137 | 'count'=> 30 |
| 138 | 138 | ), |
| 139 | 139 | 'property_sale' => array( |
| 140 | - 'name'=>__('Property for sale','geodirectory'), |
|
| 140 | + 'name'=>__('Property for sale', 'geodirectory'), |
|
| 141 | 141 | 'count'=> 10 |
| 142 | 142 | ), |
| 143 | 143 | 'property_rent' => array( |
| 144 | - 'name'=>__('Property for rent','geodirectory'), |
|
| 144 | + 'name'=>__('Property for rent', 'geodirectory'), |
|
| 145 | 145 | 'count'=> 10 |
| 146 | 146 | ) |
| 147 | 147 | ); |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | * @global object $wpdb WordPress Database object. |
| 173 | 173 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
| 174 | 174 | */ |
| 175 | -function geodir_delete_dummy_posts($post_type,$data_type) |
|
| 175 | +function geodir_delete_dummy_posts($post_type, $data_type) |
|
| 176 | 176 | { |
| 177 | 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 | 183 | foreach ($post_ids as $post_ids_obj) { |
@@ -185,9 +185,9 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | //double check posts are deleted |
| 188 | - $wpdb->get_results("DELETE FROM " . $plugin_prefix . $post_type. "_detail WHERE post_dummy='1'"); |
|
| 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 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @global object $wpdb WordPress Database object. |
| 199 | 199 | * @global object $current_user Current user object. |
| 200 | 200 | */ |
| 201 | -function geodir_insert_dummy_posts($post_type,$data_type,$item_index) |
|
| 201 | +function geodir_insert_dummy_posts($post_type, $data_type, $item_index) |
|
| 202 | 202 | { |
| 203 | 203 | |
| 204 | 204 | ini_set('max_execution_time', 999999); //300 seconds = 5 minutes |
@@ -207,45 +207,45 @@ discard block |
||
| 207 | 207 | $total_count = 0; |
| 208 | 208 | global $dummy_post_index; |
| 209 | 209 | $dummy_post_index = $item_index; |
| 210 | - foreach( $data_types as $key=>$val){ |
|
| 211 | - if($key==$data_type){ |
|
| 210 | + foreach ($data_types as $key=>$val) { |
|
| 211 | + if ($key == $data_type) { |
|
| 212 | 212 | $total_count = $val['count']; |
| 213 | - if($key=='standard_places'){ |
|
| 213 | + if ($key == 'standard_places') { |
|
| 214 | 214 | /** |
| 215 | 215 | * Contains dummy post content. |
| 216 | 216 | * |
| 217 | 217 | * @since 1.0.0 |
| 218 | 218 | * @package GeoDirectory |
| 219 | 219 | */ |
| 220 | - include_once( 'dummy-data/standard_places.php' ); |
|
| 221 | - }elseif($key=='property_sale'){ |
|
| 220 | + include_once('dummy-data/standard_places.php'); |
|
| 221 | + }elseif ($key == 'property_sale') { |
|
| 222 | 222 | /** |
| 223 | 223 | * Contains dummy property for sale post content. |
| 224 | 224 | * |
| 225 | 225 | * @since 1.6.11 |
| 226 | 226 | * @package GeoDirectory |
| 227 | 227 | */ |
| 228 | - include_once( 'dummy-data/property_sale.php' ); |
|
| 229 | - }elseif($key=='property_rent'){ |
|
| 228 | + include_once('dummy-data/property_sale.php'); |
|
| 229 | + }elseif ($key == 'property_rent') { |
|
| 230 | 230 | /** |
| 231 | 231 | * Contains dummy property for sale post content. |
| 232 | 232 | * |
| 233 | 233 | * @since 1.6.11 |
| 234 | 234 | * @package GeoDirectory |
| 235 | 235 | */ |
| 236 | - include_once( 'dummy-data/property_rent.php' ); |
|
| 236 | + include_once('dummy-data/property_rent.php'); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - do_action('geodir_insert_dummy_data_loop',$post_type,$data_type,$item_index); |
|
| 241 | + do_action('geodir_insert_dummy_data_loop', $post_type, $data_type, $item_index); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
| 245 | 245 | |
| 246 | 246 | // delete image cache on last entry |
| 247 | - if($total_count == $item_index){ |
|
| 248 | - delete_transient( 'cached_dummy_images' ); |
|
| 247 | + if ($total_count == $item_index) { |
|
| 248 | + delete_transient('cached_dummy_images'); |
|
| 249 | 249 | flush_rewrite_rules(); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| 256 | -if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined( 'GD_TESTING_MODE' ))) { |
|
| 256 | +if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined('GD_TESTING_MODE'))) { |
|
| 257 | 257 | /** |
| 258 | 258 | * GeoDirectory dummy data installation. |
| 259 | 259 | * |
@@ -269,16 +269,16 @@ discard block |
||
| 269 | 269 | global $wpdb, $plugin_prefix; |
| 270 | 270 | |
| 271 | 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>'; |
|
| 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 | 273 | } else { |
| 274 | 274 | |
| 275 | 275 | ?> |
| 276 | 276 | <table class="form-table gd-dummy-table"> |
| 277 | 277 | <tbody> |
| 278 | 278 | <tr> |
| 279 | - <td><strong><?php _e('CPT','geodirectory');?></strong></td> |
|
| 280 | - <td><strong><?php _e('Data Type','geodirectory');?></strong></td> |
|
| 281 | - <td><strong><?php _e('Action','geodirectory');?></strong></td> |
|
| 279 | + <td><strong><?php _e('CPT', 'geodirectory'); ?></strong></td> |
|
| 280 | + <td><strong><?php _e('Data Type', 'geodirectory'); ?></strong></td> |
|
| 281 | + <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td> |
|
| 282 | 282 | </tr> |
| 283 | 283 | |
| 284 | 284 | <?php |
@@ -289,18 +289,18 @@ discard block |
||
| 289 | 289 | |
| 290 | 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 | 297 | $set_dt = get_option($post_type.'_dummy_data_type'); |
| 298 | 298 | |
| 299 | 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 | 305 | echo "<tr>"; |
| 306 | 306 | echo "<td><strong>".$cpt['labels']['name']."</strong></td>"; |
@@ -309,9 +309,9 @@ discard block |
||
| 309 | 309 | $select_disabled = $post_counts > 0 ? 'disabled' : ''; |
| 310 | 310 | echo "<td>"; |
| 311 | 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'];} |
|
| 312 | + foreach ($data_types_for as $key=>$val) { |
|
| 313 | + $selected = ($key == $set_dt) ? "selected='selected'" : ''; |
|
| 314 | + if ($selected) {$count = $val['count']; } |
|
| 315 | 315 | echo "<option $selected value='$key' data-count='".$val['count']."'>".$val['name']."</option>"; |
| 316 | 316 | } |
| 317 | 317 | echo "</select>"; |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | $select_display = $post_counts > 0 ? 'display:none;' : ''; |
| 320 | 320 | echo "<select id='".$post_type."_data_type_count' style='$select_display' >"; |
| 321 | 321 | $x = 1; |
| 322 | - while($x <= $count){ |
|
| 323 | - $selected = ($x==$count) ? "selected='selected'" : ''; |
|
| 322 | + while ($x <= $count) { |
|
| 323 | + $selected = ($x == $count) ? "selected='selected'" : ''; |
|
| 324 | 324 | echo "<option $selected value='$x'>".$x."</option>"; |
| 325 | 325 | $x++; |
| 326 | 326 | } |
@@ -331,10 +331,10 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | |
| 333 | 333 | |
| 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>'; |
|
| 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 | 338 | } |
| 339 | 339 | |
| 340 | 340 | echo "</tr>"; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | } |
| 372 | 372 | var geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
| 373 | - var CITY_ADDRESS = '<?php echo addslashes( $city . ',' . $region . ',' . $country );?>'; |
|
| 373 | + var CITY_ADDRESS = '<?php echo addslashes($city.','.$region.','.$country); ?>'; |
|
| 374 | 374 | var bound_lat_lng; |
| 375 | 375 | var latlng = ['<?php echo $city_latitude; ?>', <?php echo $city_longitude; ?>]; |
| 376 | 376 | var lat = <?php echo $city_latitude; ?>; |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | return x.replace(" ", ''); |
| 401 | 401 | }); // remove spaces from lat/lon |
| 402 | 402 | } else { |
| 403 | - alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status); |
|
| 403 | + alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status); |
|
| 404 | 404 | } |
| 405 | 405 | }); |
| 406 | 406 | } else if (window.gdMaps == 'osm') { |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | var total_dummy_post_count = jQuery('#sub_' + active_tab).find('.selected_sample_data').val(); |
| 426 | 426 | |
| 427 | 427 | if (id == 'geodir_dummy_delete') { |
| 428 | - if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) { |
|
| 428 | + if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) { |
|
| 429 | 429 | jQuery('#sub_' + active_tab).find('.geodir_auto_install').hide(); |
| 430 | 430 | jQuery('#sub_' + active_tab).find('.geodir_show_progress').show(); |
| 431 | 431 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&_wpnonce=' + nonce, |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | var post_url = '<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&insert_dummy_post_index=' + dummy_post_index + '&city_bound_lat1=' + bound_lat_lng[0] + '&city_bound_lng1=' + bound_lat_lng[1] + '&city_bound_lat2=' + bound_lat_lng[2] + '&city_bound_lng2=' + bound_lat_lng[3] + '&_wpnonce=' + nonce; |
| 447 | 447 | |
| 448 | 448 | jQuery.post( post_url, function (data) { |
| 449 | - jQuery(obj).closest('form').find('.dummy_post_inserted').html('<?php _e('Dummy post(s) inserted:','geodirectory');?> ' + dummy_post_index + ' <?php _e('of' ,'geodirectory'); ?> ' + total_dummy_post_count + ''); |
|
| 449 | + jQuery(obj).closest('form').find('.dummy_post_inserted').html('<?php _e('Dummy post(s) inserted:', 'geodirectory'); ?> ' + dummy_post_index + ' <?php _e('of', 'geodirectory'); ?> ' + total_dummy_post_count + ''); |
|
| 450 | 450 | |
| 451 | 451 | dummy_post_index++; |
| 452 | 452 | |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | |
| 462 | 462 | |
| 463 | 463 | function gdRemoveDummyData(obj, nonce, posttype){ |
| 464 | - if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) { |
|
| 464 | + if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) { |
|
| 465 | 465 | jQuery(obj).prop('disabled', true); |
| 466 | 466 | jQuery('.gd-dummy-data-results-' + posttype).remove(); |
| 467 | 467 | jQuery('<tr class="gd-dummy-data-results gd-dummy-data-results-' + posttype + '" >'+ |
@@ -476,14 +476,14 @@ discard block |
||
| 476 | 476 | |
| 477 | 477 | jQuery('.gd_progressbar_'+posttype).progressbar({value: 0}); |
| 478 | 478 | |
| 479 | - gd_progressbar('.gd_progressbar_container_'+posttype, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Removing data...', 'geodirlocation'));?>'); |
|
| 479 | + gd_progressbar('.gd_progressbar_container_'+posttype, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Removing data...', 'geodirlocation')); ?>'); |
|
| 480 | 480 | |
| 481 | 481 | |
| 482 | 482 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=geodir_dummy_delete&posttype=' + posttype + '&_wpnonce=' + nonce, |
| 483 | 483 | function (data) { |
| 484 | - gd_progressbar('.gd_progressbar_container_'+posttype, 100, '<i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation'));?>'); |
|
| 484 | + gd_progressbar('.gd_progressbar_container_'+posttype, 100, '<i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation')); ?>'); |
|
| 485 | 485 | jQuery(obj).removeClass('gd-remove-data'); |
| 486 | - jQuery(obj).val('<?php _e('Insert data','geodirectory');?>'); |
|
| 486 | + jQuery(obj).val('<?php _e('Insert data', 'geodirectory'); ?>'); |
|
| 487 | 487 | jQuery(obj).prop('disabled', false); |
| 488 | 488 | jQuery('#'+posttype+'_data_type_count').show(); |
| 489 | 489 | jQuery('#'+posttype+'_data_type').prop('disabled', false); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | |
| 527 | 527 | jQuery('.gd_progressbar_'+posttype).progressbar({value: 0}); |
| 528 | 528 | |
| 529 | - gd_progressbar('.gd_progressbar_container_'+posttype, 0, '0% (0 / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Creating categories and custom fields...', 'geodirlocation'));?>'); |
|
| 529 | + gd_progressbar('.gd_progressbar_container_'+posttype, 0, '0% (0 / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Creating categories and custom fields...', 'geodirlocation')); ?>'); |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | if (!(typeof bound_lat_lng == 'object' && bound_lat_lng.length == 4)) { |
@@ -546,15 +546,15 @@ discard block |
||
| 546 | 546 | percentage = percentage > 100 ? 100 : percentage; |
| 547 | 547 | |
| 548 | 548 | |
| 549 | - gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Inserting data...', 'geodirlocation'));?>'); |
|
| 549 | + gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Inserting data...', 'geodirlocation')); ?>'); |
|
| 550 | 550 | |
| 551 | 551 | gdInstallDummyData(obj, nonce, posttype,insertedCount); |
| 552 | 552 | } |
| 553 | 553 | else { |
| 554 | 554 | percentage = 100; |
| 555 | - gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation'));?>'); |
|
| 555 | + gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation')); ?>'); |
|
| 556 | 556 | jQuery(obj).addClass('gd-remove-data'); |
| 557 | - jQuery(obj).val('<?php _e('Remove data','geodirectory');?>'); |
|
| 557 | + jQuery(obj).val('<?php _e('Remove data', 'geodirectory'); ?>'); |
|
| 558 | 558 | jQuery(obj).prop('disabled', false); |
| 559 | 559 | |
| 560 | 560 | } |
@@ -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 | |
@@ -28,31 +28,31 @@ discard block |
||
| 28 | 28 | * @package GeoDirectory |
| 29 | 29 | */ |
| 30 | 30 | function geodir_admin_styles() {
|
| 31 | - wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
|
|
| 31 | + wp_register_style('geodirectory-admin-css', geodir_plugin_url().'/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
|
|
| 32 | 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);
|
|
| 34 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 35 | 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);
|
|
| 37 | + wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 38 | 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);
|
|
| 40 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 41 | 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);
|
|
| 43 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 44 | 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);
|
|
| 46 | + wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url().'/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
|
|
| 47 | 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);
|
|
| 49 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 50 | 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);
|
|
| 52 | + wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 53 | 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);
|
|
| 55 | + wp_register_style('geodir-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
|
|
| 56 | 56 | wp_enqueue_style('geodir-rtl-style');
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | wp_register_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
| 71 | 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);
|
|
| 73 | + wp_register_script('geodirectory-admin', geodir_plugin_url().'/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
|
|
| 74 | 74 | wp_enqueue_script('geodirectory-admin');
|
| 75 | 75 | |
| 76 | 76 | } |
@@ -89,60 +89,60 @@ discard block |
||
| 89 | 89 | |
| 90 | 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);
|
|
| 94 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION);
|
|
| 95 | 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);
|
|
| 97 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
|
|
| 98 | 98 | wp_enqueue_script('geodirectory-choose-ajax');
|
| 99 | 99 | |
| 100 | 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);
|
|
| 101 | + wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url().'/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
|
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | wp_enqueue_script('geodirectory-custom-fields-script');
|
| 105 | - $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions'; |
|
| 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 | 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(); |
|
| 110 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
| 111 | + $map_key = "&key=".geodir_get_map_api_key(); |
|
| 112 | 112 | /** This filter is documented in geodirectory_template_tags.php */ |
| 113 | 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);
|
|
| 114 | + wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
|
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if ($geodir_map_name == 'osm') {
|
| 118 | 118 | // Leaflet OpenStreetMap |
| 119 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 119 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 120 | 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);
|
|
| 122 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 123 | 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);
|
|
| 125 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
|
|
| 126 | 126 | wp_enqueue_script('geodirectory-leaflet-geo-script');
|
| 127 | 127 | } |
| 128 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 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);
|
|
| 130 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 131 | 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);
|
|
| 133 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
|
|
| 134 | 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')) {
|
| 138 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 138 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 139 | 139 | wp_enqueue_script('geodir-barrating-js');
|
| 140 | 140 | } else { // default rating script
|
| 141 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION);
|
|
| 141 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION);
|
|
| 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);
|
|
| 145 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 146 | 146 | wp_enqueue_script('geodir-on-document-load');
|
| 147 | 147 | |
| 148 | 148 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | wp_enqueue_script('plupload-all');
|
| 151 | 151 | wp_enqueue_script('jquery-ui-sortable');
|
| 152 | 152 | |
| 153 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
|
|
| 153 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
|
|
| 154 | 154 | wp_enqueue_script('geodirectory-plupload-script');
|
| 155 | 155 | |
| 156 | 156 | // SCRIPT FOR UPLOAD END |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 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);
|
|
| 207 | + wp_register_script('geodirectory-admin-script', geodir_plugin_url().'/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
|
|
| 208 | 208 | wp_enqueue_script('geodirectory-admin-script');
|
| 209 | 209 | |
| 210 | 210 | wp_enqueue_style('farbtastic');
|
@@ -212,10 +212,10 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | $screen = get_current_screen(); |
| 214 | 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');
|
|
| 215 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation_admin.js');
|
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - $ajax_cons_data = array('url' => esc_url(__(get_option('siteurl') . '?geodir_ajax=true')));
|
|
| 218 | + $ajax_cons_data = array('url' => esc_url(__(get_option('siteurl').'?geodir_ajax=true')));
|
|
| 219 | 219 | wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data);
|
| 220 | 220 | |
| 221 | 221 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 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 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $geodir_menu_order[] = 'separator-geodirectory'; |
| 273 | 273 | if (!empty($post_types)) {
|
| 274 | 274 | foreach ($post_types as $post_type) {
|
| 275 | - $geodir_menu_order[] = 'edit.php?post_type=' . $post_type; |
|
| 275 | + $geodir_menu_order[] = 'edit.php?post_type='.$post_type; |
|
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | $geodir_menu_order[] = $item; |
@@ -315,8 +315,8 @@ discard block |
||
| 315 | 315 | {
|
| 316 | 316 | if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') {
|
| 317 | 317 | echo '<div id="message" class="updated fade"> |
| 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 | - <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory') . '</strong></p>
|
|
| 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 | + <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory').'</strong></p>
|
|
| 320 | 320 | </div>'; |
| 321 | 321 | |
| 322 | 322 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') {
|
| 325 | 325 | switch ($_REQUEST['msg']) {
|
| 326 | 326 | case 'success': |
| 327 | - echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>';
|
|
| 327 | + echo '<div id="message" class="updated fade"><p><strong>'.__('Your settings have been saved.', 'geodirectory').'</strong></p></div>';
|
|
| 328 | 328 | flush_rewrite_rules(false); |
| 329 | 329 | |
| 330 | 330 | break; |
@@ -332,30 +332,30 @@ discard block |
||
| 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 | - echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>';
|
|
| 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 | 338 | break; |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | $geodir_load_map = get_option('geodir_load_map');
|
| 343 | 343 | $need_map_key = false; |
| 344 | - if($geodir_load_map=='' || $geodir_load_map=='google' || $geodir_load_map=='auto' ){
|
|
| 344 | + if ($geodir_load_map == '' || $geodir_load_map == 'google' || $geodir_load_map == 'auto') {
|
|
| 345 | 345 | $need_map_key = true; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 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>';
|
|
| 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 | 350 | } |
| 351 | 351 | |
| 352 | 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>';
|
|
| 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 | 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>';
|
|
| 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 | |
@@ -375,18 +375,18 @@ discard block |
||
| 375 | 375 | function geodir_handle_option_form_submit($current_tab) |
| 376 | 376 | {
|
| 377 | 377 | global $geodir_settings; |
| 378 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) {
|
|
| 378 | + if (file_exists(dirname(__FILE__).'/option-pages/'.$current_tab.'_array.php')) {
|
|
| 379 | 379 | /** |
| 380 | 380 | * Contains settings array for current tab. |
| 381 | 381 | * |
| 382 | 382 | * @since 1.0.0 |
| 383 | 383 | * @package GeoDirectory |
| 384 | 384 | */ |
| 385 | - include_once('option-pages/' . $current_tab . '_array.php');
|
|
| 385 | + include_once('option-pages/'.$current_tab.'_array.php');
|
|
| 386 | 386 | } |
| 387 | 387 | if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') : |
| 388 | 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'));
|
|
| 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. |
@@ -419,13 +419,13 @@ discard block |
||
| 419 | 419 | * @param string $current_tab The current settings tab name. |
| 420 | 420 | * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab. |
| 421 | 421 | */ |
| 422 | - do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]);
|
|
| 422 | + do_action('geodir_update_options_'.$current_tab, $geodir_settings[$current_tab]);
|
|
| 423 | 423 | |
| 424 | 424 | flush_rewrite_rules(false); |
| 425 | 425 | |
| 426 | 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 | 430 | wp_redirect($redirect_url); |
| 431 | 431 | exit(); |
@@ -464,18 +464,18 @@ discard block |
||
| 464 | 464 | |
| 465 | 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); |
|
| 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 | 472 | else : |
| 473 | - update_option($value['id'] . '_crop', 0); |
|
| 473 | + update_option($value['id'].'_crop', 0); |
|
| 474 | 474 | endif; |
| 475 | 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); |
|
| 476 | + update_option($value['id'].'_width', $value['std']); |
|
| 477 | + update_option($value['id'].'_height', $value['std']); |
|
| 478 | + update_option($value['id'].'_crop', 1); |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | elseif (isset($value['type']) && $value['type'] == 'map') : |
@@ -517,12 +517,12 @@ discard block |
||
| 517 | 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 | 522 | if (get_option($value['id'])) {
|
| 523 | 523 | $image_name_arr = explode('/', get_option($value['id']));
|
| 524 | 524 | $noimg_name = end($image_name_arr); |
| 525 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
| 525 | + $img_path = $uploads['path'].'/'.$noimg_name; |
|
| 526 | 526 | if (file_exists($img_path)) |
| 527 | 527 | unlink($img_path); |
| 528 | 528 | } |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | if (get_option($value['id'])) {
|
| 551 | 551 | $image_name_arr = explode('/', get_option($value['id']));
|
| 552 | 552 | $noimg_name = end($image_name_arr); |
| 553 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
| 553 | + $img_path = $uploads['path'].'/'.$noimg_name; |
|
| 554 | 554 | if (file_exists($img_path)) |
| 555 | 555 | unlink($img_path); |
| 556 | 556 | } |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | // same menu setting per theme. |
| 572 | 572 | if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
|
| 573 | 573 | $theme = wp_get_theme(); |
| 574 | - update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
|
|
| 574 | + update_option('geodir_theme_location_nav_'.$theme->name, $_POST[$value['id']]);
|
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | if (isset($value['id']) && isset($_POST[$value['id']])) {
|
@@ -641,8 +641,8 @@ discard block |
||
| 641 | 641 | |
| 642 | 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'), |
|
| 644 | + $tabs[$geodir_post_type.'_fields_settings'] = array( |
|
| 645 | + 'label' => __(ucfirst($listing_slug).' Settings', 'geodirectory'), |
|
| 646 | 646 | 'subtabs' => array( |
| 647 | 647 | array('subtab' => 'custom_fields',
|
| 648 | 648 | 'label' => __('Custom Fields', 'geodirectory'),
|
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | */ |
| 676 | 676 | function geodir_tools_setting_tab($tabs) |
| 677 | 677 | {
|
| 678 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
| 678 | + wp_enqueue_script('jquery-ui-progressbar');
|
|
| 679 | 679 | $tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory'));
|
| 680 | 680 | return $tabs; |
| 681 | 681 | } |
@@ -709,7 +709,7 @@ 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');
|
|
| 712 | + $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory').' <i class="fa fa-plug"></i>', 'url' => 'https://wpgeodirectory.com', 'target' => '_blank');
|
|
| 713 | 713 | return $tabs; |
| 714 | 714 | } |
| 715 | 715 | |
@@ -769,8 +769,8 @@ discard block |
||
| 769 | 769 | _e('Unknown', 'geodirectory');
|
| 770 | 770 | } else {
|
| 771 | 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); |
|
| 772 | + $add_location_id = $location_id > 0 ? ' ('.$location_id.')' : '';
|
|
| 773 | + echo(__($location->country, 'geodirectory').'-'.$location->region.'-'.$location->city.$add_location_id); |
|
| 774 | 774 | } |
| 775 | 775 | break; |
| 776 | 776 | |
@@ -788,14 +788,14 @@ discard block |
||
| 788 | 788 | $expire_class = 'expire_over'; |
| 789 | 789 | } |
| 790 | 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>';
|
|
| 791 | + $date_diff_text = '<br /><span class="'.$expire_class.'">('.$date_diff.' '.$state.')</span>';
|
|
| 792 | 792 | } |
| 793 | 793 | /* If no expire_date is found, output a default message. */ |
| 794 | 794 | if (empty($expire_date)) |
| 795 | 795 | echo __('Unknown', 'geodirectory');
|
| 796 | 796 | /* If there is a expire_date, append 'days left' to the text string. */ |
| 797 | 797 | else |
| 798 | - echo $expire_date . $date_diff_text; |
|
| 798 | + echo $expire_date.$date_diff_text; |
|
| 799 | 799 | break; |
| 800 | 800 | |
| 801 | 801 | /* If displaying the 'categorys' column. */ |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | function geodir_post_information_save($post_id, $post) {
|
| 863 | 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')) {
|
|
| 865 | + if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) {
|
|
| 866 | 866 | return; |
| 867 | 867 | } |
| 868 | 868 | |
@@ -930,7 +930,7 @@ discard block |
||
| 930 | 930 | $tab_id = $value['id']; |
| 931 | 931 | |
| 932 | 932 | if (isset($value['desc']) && $value['desc']) |
| 933 | - $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
| 933 | + $desc = '<span style=" text-transform:none;">:- '.$value['desc'].'</span>'; |
|
| 934 | 934 | |
| 935 | 935 | if (isset($value['name']) && $value['name']) {
|
| 936 | 936 | if ($first_title === true) {
|
@@ -938,9 +938,9 @@ discard block |
||
| 938 | 938 | } else {
|
| 939 | 939 | echo '</div>'; |
| 940 | 940 | } |
| 941 | - echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>'; |
|
| 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;" >'; |
|
| 943 | + echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | /** |
@@ -950,21 +950,21 @@ discard block |
||
| 950 | 950 | * |
| 951 | 951 | * @since 1.0.0 |
| 952 | 952 | */ |
| 953 | - do_action('geodir_settings_' . sanitize_title($value['id']));
|
|
| 953 | + do_action('geodir_settings_'.sanitize_title($value['id']));
|
|
| 954 | 954 | break; |
| 955 | 955 | |
| 956 | 956 | case 'no_tabs': |
| 957 | 957 | |
| 958 | 958 | echo '<div class="inner_content_tab_main">'; |
| 959 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 959 | + echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
| 960 | 960 | |
| 961 | 961 | break; |
| 962 | 962 | |
| 963 | 963 | case 'sectionstart': |
| 964 | 964 | if (isset($value['desc']) && $value['desc']) |
| 965 | - $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>'; |
|
| 965 | + $desc = '<span style=" text-transform:none;"> - '.$value['desc'].'</span>'; |
|
| 966 | 966 | if (isset($value['name']) && $value['name']) |
| 967 | - echo '<h3>' . $value['name'] . $desc . '</h3>'; |
|
| 967 | + echo '<h3>'.$value['name'].$desc.'</h3>'; |
|
| 968 | 968 | /** |
| 969 | 969 | * Called after a GeoDirectory settings sectionstart is output in the GD settings page. |
| 970 | 970 | * |
@@ -972,8 +972,8 @@ discard block |
||
| 972 | 972 | * |
| 973 | 973 | * @since 1.0.0 |
| 974 | 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"; |
|
| 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 | 977 | |
| 978 | 978 | break; |
| 979 | 979 | case 'sectionend': |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | * |
| 985 | 985 | * @since 1.0.0 |
| 986 | 986 | */ |
| 987 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
|
|
| 987 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_end');
|
|
| 988 | 988 | echo '</table>'; |
| 989 | 989 | /** |
| 990 | 990 | * Called after a GeoDirectory settings sectionend is output in the GD settings page. |
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | * |
| 994 | 994 | * @since 1.0.0 |
| 995 | 995 | */ |
| 996 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
|
|
| 996 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_after');
|
|
| 997 | 997 | break; |
| 998 | 998 | case 'text': |
| 999 | 999 | ?> |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
| 1003 | 1003 | id="<?php echo esc_attr($value['id']); ?>" |
| 1004 | 1004 | type="<?php echo esc_attr($value['type']); ?>" |
| 1005 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 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 | 1008 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
| 1020 | 1020 | id="<?php echo esc_attr($value['id']); ?>" |
| 1021 | 1021 | type="<?php echo esc_attr($value['type']); ?>" |
| 1022 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 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 | 1025 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -1065,17 +1065,17 @@ discard block |
||
| 1065 | 1065 | <?php _e('Width', 'geodirectory'); ?> <input
|
| 1066 | 1066 | name="<?php echo esc_attr($value['id']); ?>_width" |
| 1067 | 1067 | id="<?php echo esc_attr($value['id']); ?>_width" type="text" size="3" |
| 1068 | - value="<?php if ($size = get_option($value['id'] . '_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
| 1068 | + value="<?php if ($size = get_option($value['id'].'_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
| 1069 | 1069 | |
| 1070 | 1070 | <?php _e('Height', 'geodirectory'); ?> <input
|
| 1071 | 1071 | name="<?php echo esc_attr($value['id']); ?>_height" |
| 1072 | 1072 | id="<?php echo esc_attr($value['id']); ?>_height" type="text" size="3" |
| 1073 | - value="<?php if ($size = get_option($value['id'] . '_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
| 1073 | + value="<?php if ($size = get_option($value['id'].'_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
| 1074 | 1074 | |
| 1075 | 1075 | <label><?php _e('Hard Crop', 'geodirectory'); ?> <input
|
| 1076 | 1076 | name="<?php echo esc_attr($value['id']); ?>_crop" |
| 1077 | 1077 | id="<?php echo esc_attr($value['id']); ?>_crop" |
| 1078 | - type="checkbox" <?php if (get_option($value['id'] . '_crop') != '') checked(get_option($value['id'] . '_crop'), 1); else checked(1); ?> /></label> |
|
| 1078 | + type="checkbox" <?php if (get_option($value['id'].'_crop') != '') checked(get_option($value['id'].'_crop'), 1); else checked(1); ?> /></label> |
|
| 1079 | 1079 | |
| 1080 | 1080 | <span class="description"><?php echo $value['desc'] ?></span></td> |
| 1081 | 1081 | </tr><?php |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | id="<?php echo esc_attr($value['id']); ?>" |
| 1126 | 1126 | style="<?php echo esc_attr($value['css']); ?>" |
| 1127 | 1127 | class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
| 1128 | - data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>" |
|
| 1128 | + data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text']; ?>" |
|
| 1129 | 1129 | option-ajaxchosen="false"> |
| 1130 | 1130 | <?php |
| 1131 | 1131 | foreach ($value['options'] as $key => $val) {
|
@@ -1136,7 +1136,7 @@ discard block |
||
| 1136 | 1136 | } else {
|
| 1137 | 1137 | ?> |
| 1138 | 1138 | <option |
| 1139 | - value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values)));?>><?php echo ucfirst($val) ?></option> |
|
| 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 | 1141 | } |
| 1142 | 1142 | } |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | ?> |
| 1172 | 1172 | |
| 1173 | 1173 | <tr valign="top"> |
| 1174 | - <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th>
|
|
| 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 |
@@ -1253,7 +1253,7 @@ discard block |
||
| 1253 | 1253 | |
| 1254 | 1254 | <tr valign="top"> |
| 1255 | 1255 | <th class="titledesc" |
| 1256 | - width="40%"><?php _e('Default post type search on map', 'geodirectory');?></th>
|
|
| 1256 | + width="40%"><?php _e('Default post type search on map', 'geodirectory'); ?></th>
|
|
| 1257 | 1257 | <td width="60%"> |
| 1258 | 1258 | <select name="geodir_default_map_search_pt" style="width:60%"> |
| 1259 | 1259 | <?php |
@@ -1294,7 +1294,7 @@ discard block |
||
| 1294 | 1294 | $cat_display = 'checkbox'; |
| 1295 | 1295 | $gd_post_types = get_option('geodir_exclude_post_type_on_map');
|
| 1296 | 1296 | $gd_cats = get_option('geodir_exclude_cat_on_map');
|
| 1297 | - $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
|
|
| 1297 | + $gd_cats_upgrade = (int) get_option('geodir_exclude_cat_on_map_upgrade');
|
|
| 1298 | 1298 | $count = 1; |
| 1299 | 1299 | ?> |
| 1300 | 1300 | <table width="70%" class="widefat"> |
@@ -1323,7 +1323,7 @@ discard block |
||
| 1323 | 1323 | name="home_map_post_types[]" |
| 1324 | 1324 | id="<?php echo esc_attr($value['id']); ?>" |
| 1325 | 1325 | value="<?php echo $key; ?>" |
| 1326 | - class="map_post_type" <?php echo $checked;?> /> |
|
| 1326 | + class="map_post_type" <?php echo $checked; ?> /> |
|
| 1327 | 1327 | <?php echo $post_types_obj->labels->singular_name; ?></td> |
| 1328 | 1328 | <td width="40%"> |
| 1329 | 1329 | <div class="home_map_category" style="overflow:auto;width:200px;height:100px;" |
@@ -1381,12 +1381,12 @@ discard block |
||
| 1381 | 1381 | ?> |
| 1382 | 1382 | <fieldset> |
| 1383 | 1383 | <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend> |
| 1384 | - <label for="<?php echo $value['id'];?>"> |
|
| 1384 | + <label for="<?php echo $value['id']; ?>"> |
|
| 1385 | 1385 | <input name="<?php echo esc_attr($value['id']); ?>" |
| 1386 | - id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio" |
|
| 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 | 1388 | echo 'checked="checked"'; |
| 1389 | - }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){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 |
@@ -1406,9 +1406,9 @@ discard block |
||
| 1406 | 1406 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1407 | 1407 | <td class="forminp"> |
| 1408 | 1408 | <textarea |
| 1409 | - <?php if (isset($value['args'])) echo $value['args'] . ' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
| 1409 | + <?php if (isset($value['args'])) echo $value['args'].' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
| 1410 | 1410 | id="<?php echo esc_attr($value['id']); ?>" |
| 1411 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 1411 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 1412 | 1412 | style="<?php echo esc_attr($value['css']); ?>"><?php if (get_option($value['id'])) echo esc_textarea(stripslashes(get_option($value['id']))); else echo esc_textarea($value['std']); ?></textarea><span |
| 1413 | 1413 | class="description"><?php echo $value['desc'] ?></span> |
| 1414 | 1414 | |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | } |
| 1454 | 1454 | } |
| 1455 | 1455 | // |
| 1456 | - $page_setting = (int)get_option($value['id']); |
|
| 1456 | + $page_setting = (int) get_option($value['id']); |
|
| 1457 | 1457 | |
| 1458 | 1458 | $args = array('name' => $value['id'],
|
| 1459 | 1459 | 'id' => $value['id'], |
@@ -1470,7 +1470,7 @@ discard block |
||
| 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"> |
| 1473 | - <?php echo str_replace(' id=', " data-placeholder='" . __('Select a page...', 'geodirectory') . "' style='" . $value['css'] . "' class='" . $value['class'] . "' " . $disabled . " id=", wp_dropdown_pages($args)); ?>
|
|
| 1473 | + <?php echo str_replace(' id=', " data-placeholder='".__('Select a page...', 'geodirectory')."' style='".$value['css']."' class='".$value['class']."' ".$disabled." id=", wp_dropdown_pages($args)); ?>
|
|
| 1474 | 1474 | <span class="description"><?php echo $value['desc'] ?></span> |
| 1475 | 1475 | </td> |
| 1476 | 1476 | </tr><?php |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | } |
| 1480 | 1480 | break; |
| 1481 | 1481 | case 'single_select_country' : |
| 1482 | - $country_setting = (string)get_option($value['id']); |
|
| 1482 | + $country_setting = (string) get_option($value['id']); |
|
| 1483 | 1483 | if (strstr($country_setting, ':')) : |
| 1484 | 1484 | $country = current(explode(':', $country_setting));
|
| 1485 | 1485 | $state = end(explode(':', $country_setting));
|
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | case 'multi_select_countries' : |
| 1503 | 1503 | $countries = $geodirectory->countries->countries; |
| 1504 | 1504 | asort($countries); |
| 1505 | - $selections = (array)get_option($value['id']); |
|
| 1505 | + $selections = (array) get_option($value['id']); |
|
| 1506 | 1506 | ?> |
| 1507 | 1507 | <tr valign="top"> |
| 1508 | 1508 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | title="Country" class="chosen_select"> |
| 1513 | 1513 | <?php |
| 1514 | 1514 | if ($countries) foreach ($countries as $key => $val) : |
| 1515 | - echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
| 1515 | + echo '<option value="'.$key.'" '.selected(in_array($key, $selections), true, false).'>'.$val.'</option>'; |
|
| 1516 | 1516 | endforeach; |
| 1517 | 1517 | ?> |
| 1518 | 1518 | </select> |
@@ -1524,7 +1524,7 @@ discard block |
||
| 1524 | 1524 | break; |
| 1525 | 1525 | |
| 1526 | 1526 | case 'google_analytics' : |
| 1527 | - $selections = (array)get_option($value['id']); |
|
| 1527 | + $selections = (array) get_option($value['id']); |
|
| 1528 | 1528 | ?> |
| 1529 | 1529 | <tr valign="top"> |
| 1530 | 1530 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -1535,27 +1535,27 @@ discard block |
||
| 1535 | 1535 | |
| 1536 | 1536 | $oAuthURL = "https://accounts.google.com/o/oauth2/auth?"; |
| 1537 | 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";
|
|
| 1538 | + $state = "&state=123"; //any string |
|
| 1539 | + $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback";
|
|
| 1540 | 1540 | $response_type = "&response_type=code"; |
| 1541 | 1541 | $client_id = "&client_id=".get_option('geodir_ga_client_id');
|
| 1542 | 1542 | $access_type = "&access_type=offline"; |
| 1543 | 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 | 1548 | if (get_option('geodir_ga_auth_token')) {
|
| 1549 | 1549 | ?> |
| 1550 | 1550 | <span class="button-primary" |
| 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>
|
|
| 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 | 1555 | } else {
|
| 1556 | 1556 | ?> |
| 1557 | 1557 | <span class="button-primary" |
| 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>
|
|
| 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 | 1560 | } |
| 1561 | 1561 | ?> |
@@ -1626,9 +1626,9 @@ discard block |
||
| 1626 | 1626 | |
| 1627 | 1627 | <?php if (isset($_REQUEST['active_tab']) && $_REQUEST['active_tab'] != '') { ?>
|
| 1628 | 1628 | jQuery('.geodir_option_tabs').removeClass('gd-tab-active');
|
| 1629 | - jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').addClass('gd-tab-active');
|
|
| 1629 | + jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').addClass('gd-tab-active');
|
|
| 1630 | 1630 | jQuery('.gd-content-heading').hide();
|
| 1631 | - jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').show();
|
|
| 1631 | + jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').show();
|
|
| 1632 | 1632 | <?php } ?> |
| 1633 | 1633 | }); |
| 1634 | 1634 | </script> |
@@ -1714,7 +1714,7 @@ discard block |
||
| 1714 | 1714 | wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename'); |
| 1715 | 1715 | |
| 1716 | 1716 | if (geodir_get_featured_image($post_id, 'thumbnail')) {
|
| 1717 | - echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>';
|
|
| 1717 | + echo '<h4>'.__('Featured Image', 'geodirectory').'</h4>';
|
|
| 1718 | 1718 | geodir_show_featured_image($post_id, 'thumbnail'); |
| 1719 | 1719 | } |
| 1720 | 1720 | |
@@ -1725,13 +1725,13 @@ discard block |
||
| 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>';
|
|
| 1728 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
|
|
| 1729 | 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>';
|
|
| 1731 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
|
|
| 1732 | 1732 | } ?> |
| 1733 | 1733 | <?php if ($image_limit == 0) {
|
| 1734 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 1734 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
|
|
| 1735 | 1735 | } ?> |
| 1736 | 1736 | </h5> |
| 1737 | 1737 | |
@@ -1770,10 +1770,10 @@ discard block |
||
| 1770 | 1770 | <div |
| 1771 | 1771 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 1772 | 1772 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 1773 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4>
|
|
| 1773 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4>
|
|
| 1774 | 1774 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 1775 | 1775 | value="<?php _e('Select Files', 'geodirectory'); ?>" class="button"/>
|
| 1776 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
| 1776 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
| 1777 | 1777 | <?php if ($width && $height): ?> |
| 1778 | 1778 | <span class="plupload-resize"></span> |
| 1779 | 1779 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 1786 | 1786 | </div> |
| 1787 | 1787 | <span |
| 1788 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 1788 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 1789 | 1789 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 1790 | 1790 | </div> |
| 1791 | 1791 | |
@@ -1995,9 +1995,9 @@ discard block |
||
| 1995 | 1995 | $plugin = 'avada-nag'; |
| 1996 | 1996 | $timestamp = 'avada-nag1234'; |
| 1997 | 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' > ";
|
|
| 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 | 2001 | echo "<p>$message</p>"; |
| 2002 | 2002 | echo "</div>"; |
| 2003 | 2003 | |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | |
| 2131 | 2131 | // Don't allow same slug url for listing and location |
| 2132 | 2132 | if (geodir_strtolower($listing_prefix) == geodir_strtolower($location_prefix)) {
|
| 2133 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab . '&msg=fail&gderr=21');
|
|
| 2133 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab.'&msg=fail&gderr=21');
|
|
| 2134 | 2134 | wp_redirect($redirect_url); |
| 2135 | 2135 | exit; |
| 2136 | 2136 | } |
@@ -2142,7 +2142,7 @@ discard block |
||
| 2142 | 2142 | $default_language = $sitepress->get_default_language(); |
| 2143 | 2143 | |
| 2144 | 2144 | if ($current_language != 'all' && $current_language != $default_language) {
|
| 2145 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab);
|
|
| 2145 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab);
|
|
| 2146 | 2146 | wp_redirect($redirect_url); |
| 2147 | 2147 | exit; |
| 2148 | 2148 | } |
@@ -2163,11 +2163,11 @@ discard block |
||
| 2163 | 2163 | function geodir_hide_admin_preview_button() {
|
| 2164 | 2164 | global $post_type; |
| 2165 | 2165 | $post_types = geodir_get_posttypes(); |
| 2166 | - if(in_array($post_type, $post_types)) |
|
| 2166 | + if (in_array($post_type, $post_types)) |
|
| 2167 | 2167 | echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
|
| 2168 | 2168 | } |
| 2169 | -add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' ); |
|
| 2170 | -add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' ); |
|
| 2169 | +add_action('admin_head-post-new.php', 'geodir_hide_admin_preview_button');
|
|
| 2170 | +add_action('admin_head-post.php', 'geodir_hide_admin_preview_button');
|
|
| 2171 | 2171 | |
| 2172 | 2172 | /** |
| 2173 | 2173 | * Add the tab in left sidebar menu fro import & export page. |
@@ -2177,8 +2177,8 @@ discard block |
||
| 2177 | 2177 | * |
| 2178 | 2178 | * @return array Array of tab data. |
| 2179 | 2179 | */ |
| 2180 | -function geodir_import_export_tab( $tabs ) {
|
|
| 2181 | - $tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) ); |
|
| 2180 | +function geodir_import_export_tab($tabs) {
|
|
| 2181 | + $tabs['import_export'] = array('label' => __('Import & Export', 'geodirectory'));
|
|
| 2182 | 2182 | return $tabs; |
| 2183 | 2183 | } |
| 2184 | 2184 | |
@@ -2192,8 +2192,8 @@ discard block |
||
| 2192 | 2192 | * @return string Html content. |
| 2193 | 2193 | */ |
| 2194 | 2194 | function geodir_import_export_page() {
|
| 2195 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
| 2196 | - $gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv'; |
|
| 2195 | + $nonce = wp_create_nonce('geodir_import_export_nonce');
|
|
| 2196 | + $gd_cats_sample_csv = geodir_plugin_url().'/geodirectory-assets/gd_sample_categories.csv'; |
|
| 2197 | 2197 | /** |
| 2198 | 2198 | * Filter sample category data csv file url. |
| 2199 | 2199 | * |
@@ -2202,9 +2202,9 @@ discard block |
||
| 2202 | 2202 | * |
| 2203 | 2203 | * @param string $gd_cats_sample_csv Sample category data csv file url. |
| 2204 | 2204 | */ |
| 2205 | - $gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv ); |
|
| 2205 | + $gd_cats_sample_csv = apply_filters('geodir_export_cats_sample_csv', $gd_cats_sample_csv);
|
|
| 2206 | 2206 | |
| 2207 | - $gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv'; |
|
| 2207 | + $gd_posts_sample_csv = geodir_plugin_url().'/geodirectory-assets/place_listing.csv'; |
|
| 2208 | 2208 | /** |
| 2209 | 2209 | * Filter sample post data csv file url. |
| 2210 | 2210 | * |
@@ -2213,15 +2213,15 @@ discard block |
||
| 2213 | 2213 | * |
| 2214 | 2214 | * @param string $gd_posts_sample_csv Sample post data csv file url. |
| 2215 | 2215 | */ |
| 2216 | - $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv ); |
|
| 2216 | + $gd_posts_sample_csv = apply_filters('geodir_export_posts_sample_csv', $gd_posts_sample_csv);
|
|
| 2217 | 2217 | |
| 2218 | - $gd_posttypes = geodir_get_posttypes( 'array' ); |
|
| 2218 | + $gd_posttypes = geodir_get_posttypes('array');
|
|
| 2219 | 2219 | |
| 2220 | 2220 | $gd_posttypes_option = ''; |
| 2221 | - foreach ( $gd_posttypes as $gd_posttype => $row ) {
|
|
| 2222 | - $gd_posttypes_option .= '<option value="' . $gd_posttype . '" data-cats="' . (int)geodir_get_terms_count( $gd_posttype ) . '" data-posts="' . (int)geodir_get_posts_count( $gd_posttype ) . '">' . __( $row['labels']['name'], 'geodirectory' ) . '</option>'; |
|
| 2221 | + foreach ($gd_posttypes as $gd_posttype => $row) {
|
|
| 2222 | + $gd_posttypes_option .= '<option value="'.$gd_posttype.'" data-cats="'.(int) geodir_get_terms_count($gd_posttype).'" data-posts="'.(int) geodir_get_posts_count($gd_posttype).'">'.__($row['labels']['name'], 'geodirectory').'</option>'; |
|
| 2223 | 2223 | } |
| 2224 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
| 2224 | + wp_enqueue_script('jquery-ui-progressbar');
|
|
| 2225 | 2225 | |
| 2226 | 2226 | $gd_chunksize_options = array(); |
| 2227 | 2227 | $gd_chunksize_options[100] = 100; |
@@ -2243,49 +2243,49 @@ discard block |
||
| 2243 | 2243 | * |
| 2244 | 2244 | * @param string $gd_chunksize_options Entries options. |
| 2245 | 2245 | */ |
| 2246 | - $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options ); |
|
| 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) {
|
| 2250 | - $gd_chunksize_option .= '<option value="' . $value . '" ' . selected($value, 5000, false) . '>' . $title . '</option>'; |
|
| 2250 | + $gd_chunksize_option .= '<option value="'.$value.'" '.selected($value, 5000, false).'>'.$title.'</option>'; |
|
| 2251 | 2251 | } |
| 2252 | 2252 | |
| 2253 | 2253 | $uploads = wp_upload_dir(); |
| 2254 | 2254 | ?> |
| 2255 | 2255 | </form> |
| 2256 | 2256 | <div class="inner_content_tab_main gd-import-export"> |
| 2257 | - <h3><?php _e( 'GD Import & Export CSV', 'geodirectory' ) ;?></h3> |
|
| 2258 | - <span class="description"><?php _e( 'Import & export csv for GD listings & categories.', 'geodirectory' ) ;?></span> |
|
| 2257 | + <h3><?php _e('GD Import & Export CSV', 'geodirectory'); ?></h3>
|
|
| 2258 | + <span class="description"><?php _e('Import & export csv for GD listings & categories.', 'geodirectory'); ?></span>
|
|
| 2259 | 2259 | <div class="gd-content-heading"> |
| 2260 | 2260 | |
| 2261 | 2261 | <?php |
| 2262 | 2262 | ini_set('max_execution_time', 999999);
|
| 2263 | - $ini_max_execution_time_check = @ini_get( 'max_execution_time' ); |
|
| 2263 | + $ini_max_execution_time_check = @ini_get('max_execution_time');
|
|
| 2264 | 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
|
|
| 2266 | + if ($ini_max_execution_time_check != 999999) { // only show these setting to the user if we can't change the ini setting
|
|
| 2267 | 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"> |
| 2271 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'PHP Requirements for GD Import & Export CSV', 'geodirectory' );?></span></h3> |
|
| 2271 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('PHP Requirements for GD Import & Export CSV', 'geodirectory'); ?></span></h3>
|
|
| 2272 | 2272 | <div class="inside"> |
| 2273 | - <span class="description"><?php echo __( 'Note: In case GD import & export csv not working for larger data then please check and configure following php settings.', 'geodirectory' );?></span> |
|
| 2273 | + <span class="description"><?php echo __('Note: In case GD import & export csv not working for larger data then please check and configure following php settings.', 'geodirectory'); ?></span>
|
|
| 2274 | 2274 | <table class="form-table"> |
| 2275 | 2275 | <thead> |
| 2276 | 2276 | <tr> |
| 2277 | - <th><?php _e( 'PHP Settings', 'geodirectory' );?></th><th><?php _e( 'Current Value', 'geodirectory' );?></th><th><?php _e( 'Recommended Value', 'geodirectory' );?></th> |
|
| 2277 | + <th><?php _e('PHP Settings', 'geodirectory'); ?></th><th><?php _e('Current Value', 'geodirectory'); ?></th><th><?php _e('Recommended Value', 'geodirectory'); ?></th>
|
|
| 2278 | 2278 | </tr> |
| 2279 | 2279 | </thead> |
| 2280 | 2280 | <tbody> |
| 2281 | 2281 | <tr> |
| 2282 | - <td>max_input_time</td><td><?php echo @ini_get( 'max_input_time' );?></td><td>3000</td> |
|
| 2282 | + <td>max_input_time</td><td><?php echo @ini_get('max_input_time'); ?></td><td>3000</td>
|
|
| 2283 | 2283 | </tr> |
| 2284 | 2284 | <tr> |
| 2285 | - <td>max_execution_time</td><td><?php echo @ini_get( 'max_execution_time' );?></td><td>3000</td> |
|
| 2285 | + <td>max_execution_time</td><td><?php echo @ini_get('max_execution_time'); ?></td><td>3000</td>
|
|
| 2286 | 2286 | </tr> |
| 2287 | 2287 | <tr> |
| 2288 | - <td>memory_limit</td><td><?php echo @ini_get( 'memory_limit' );?></td><td>256M</td> |
|
| 2288 | + <td>memory_limit</td><td><?php echo @ini_get('memory_limit'); ?></td><td>256M</td>
|
|
| 2289 | 2289 | </tr> |
| 2290 | 2290 | </tbody> |
| 2291 | 2291 | </table> |
@@ -2297,21 +2297,21 @@ discard block |
||
| 2297 | 2297 | <div id="gd_ie_imposts" class="metabox-holder"> |
| 2298 | 2298 | <div class="meta-box-sortables ui-sortable"> |
| 2299 | 2299 | <div id="gd_ie_im_posts" class="postbox gd-hndle-pbox"> |
| 2300 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Listings: Import CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
| 2301 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Import CSV', 'geodirectory' );?></span></h3> |
|
| 2300 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Listings: Import CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
|
|
| 2301 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Import CSV', 'geodirectory'); ?></span></h3>
|
|
| 2302 | 2302 | <div class="inside"> |
| 2303 | 2303 | <table class="form-table"> |
| 2304 | 2304 | <tbody> |
| 2305 | 2305 | <tr> |
| 2306 | 2306 | <td class="gd-imex-box"> |
| 2307 | 2307 | <div class="gd-im-choices"> |
| 2308 | - <p><input type="radio" value="update" name="gd_im_choicepost" id="gd_im_pchoice_u" /><label for="gd_im_pchoice_u"><?php _e( 'Update listing if post with post_id already exists.', 'geodirectory' );?></label></p> |
|
| 2309 | - <p><input type="radio" checked="checked" value="skip" name="gd_im_choicepost" id="gd_im_pchoice_s" /><label for="gd_im_pchoice_s"><?php _e( 'Ignore listing if post with post_id already exists.', 'geodirectory' );?></label></p> |
|
| 2308 | + <p><input type="radio" value="update" name="gd_im_choicepost" id="gd_im_pchoice_u" /><label for="gd_im_pchoice_u"><?php _e('Update listing if post with post_id already exists.', 'geodirectory'); ?></label></p>
|
|
| 2309 | + <p><input type="radio" checked="checked" value="skip" name="gd_im_choicepost" id="gd_im_pchoice_s" /><label for="gd_im_pchoice_s"><?php _e('Ignore listing if post with post_id already exists.', 'geodirectory'); ?></label></p>
|
|
| 2310 | 2310 | </div> |
| 2311 | 2311 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_postplupload-upload-ui"> |
| 2312 | 2312 | <input type="text" readonly="readonly" name="gd_im_post_file" class="gd-imex-file gd_im_post_file" id="gd_im_post" onclick="jQuery('#gd_im_postplupload-browse-button').trigger('click');" />
|
| 2313 | - <input id="gd_im_postplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-pupload button-primary" /><input type="button" value="<?php echo esc_attr( __( 'Download Sample CSV', 'geodirectory' ) );?>" class="button-secondary" name="gd_ie_imposts_sample" id="gd_ie_imposts_sample"> |
|
| 2314 | - <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv;?>" /> |
|
| 2313 | + <input id="gd_im_postplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-pupload button-primary" /><input type="button" value="<?php echo esc_attr(__('Download Sample CSV', 'geodirectory')); ?>" class="button-secondary" name="gd_ie_imposts_sample" id="gd_ie_imposts_sample">
|
|
| 2314 | + <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv; ?>" /> |
|
| 2315 | 2315 | <?php |
| 2316 | 2316 | /** |
| 2317 | 2317 | * Called just after the sample CSV download link. |
@@ -2320,7 +2320,7 @@ discard block |
||
| 2320 | 2320 | */ |
| 2321 | 2321 | do_action('geodir_sample_csv_download_link');
|
| 2322 | 2322 | ?> |
| 2323 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_postpluploadan' ); ?>"></span> |
|
| 2323 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_postpluploadan'); ?>"></span>
|
|
| 2324 | 2324 | <div class="filelist"></div> |
| 2325 | 2325 | </div> |
| 2326 | 2326 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -2338,7 +2338,7 @@ discard block |
||
| 2338 | 2338 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
| 2339 | 2339 | </div> |
| 2340 | 2340 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
| 2341 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
|
|
| 2341 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
|
|
| 2342 | 2342 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
| 2343 | 2343 | id="gd-import-perc">0%</font> ) |
| 2344 | 2344 | <div class="gd-fileprogress"></div> |
@@ -2350,10 +2350,10 @@ discard block |
||
| 2350 | 2350 | <div class="gd-imex-btns" style="display:none;"> |
| 2351 | 2351 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
| 2352 | 2352 | <input onclick="gd_imex_PrepareImport(this, 'post')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
| 2353 | - <input onclick="gd_imex_ContinueImport(this, 'post')" type="button" value="<?php _e( "Continue Import Data", 'geodirectory' );?>" id="gd_continue_data" class="button-primary" style="display:none"/> |
|
| 2354 | - <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'post')"/>
|
|
| 2353 | + <input onclick="gd_imex_ContinueImport(this, 'post')" type="button" value="<?php _e("Continue Import Data", 'geodirectory'); ?>" id="gd_continue_data" class="button-primary" style="display:none"/>
|
|
| 2354 | + <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'post')"/>
|
|
| 2355 | 2355 | <div id="gd_process_data" style="display:none"> |
| 2356 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
|
|
| 2356 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
|
|
| 2357 | 2357 | </div> |
| 2358 | 2358 | </div> |
| 2359 | 2359 | </td> |
@@ -2367,30 +2367,30 @@ discard block |
||
| 2367 | 2367 | <div id="gd_ie_excategs" class="metabox-holder"> |
| 2368 | 2368 | <div class="meta-box-sortables ui-sortable"> |
| 2369 | 2369 | <div id="gd_ie_ex_posts" class="postbox gd-hndle-pbox"> |
| 2370 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - Listings: Export CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
| 2371 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Export CSV', 'geodirectory' );?></span></h3> |
|
| 2370 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - Listings: Export CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
|
|
| 2371 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Export CSV', 'geodirectory'); ?></span></h3>
|
|
| 2372 | 2372 | <div class="inside"> |
| 2373 | 2373 | <table class="form-table"> |
| 2374 | 2374 | <tbody> |
| 2375 | 2375 | <tr> |
| 2376 | 2376 | <td class="fld"><label for="gd_post_type"> |
| 2377 | - <?php _e( 'Post Type:', 'geodirectory' );?> |
|
| 2377 | + <?php _e('Post Type:', 'geodirectory'); ?>
|
|
| 2378 | 2378 | </label></td> |
| 2379 | 2379 | <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"> |
| 2380 | - <?php echo $gd_posttypes_option;?> |
|
| 2380 | + <?php echo $gd_posttypes_option; ?> |
|
| 2381 | 2381 | </select></td> |
| 2382 | 2382 | </tr> |
| 2383 | 2383 | <tr> |
| 2384 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
| 2385 | - <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option;?></select><span class="description"><?php _e( 'Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory' );?></span></td> |
|
| 2384 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td>
|
|
| 2385 | + <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option; ?></select><span class="description"><?php _e('Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory'); ?></span></td>
|
|
| 2386 | 2386 | </tr> |
| 2387 | 2387 | <tr class="gd-imex-dates"> |
| 2388 | - <td class="fld"><label><?php _e( 'Published Date:', 'geodirectory' );?></label></td> |
|
| 2389 | - <td><label><span class="label-responsive"><?php _e( 'Start date:', 'geodirectory' );?></span><input type="text" id="gd_imex_start_date" name="gd_imex[start_date]" data-type="date" /></label><label><span class="label-responsive"><?php _e( 'End date:', 'geodirectory' );?></span><input type="text" id="gd_imex_end_date" name="gd_imex[end_date]" data-type="date" /></label></td> |
|
| 2388 | + <td class="fld"><label><?php _e('Published Date:', 'geodirectory'); ?></label></td>
|
|
| 2389 | + <td><label><span class="label-responsive"><?php _e('Start date:', 'geodirectory'); ?></span><input type="text" id="gd_imex_start_date" name="gd_imex[start_date]" data-type="date" /></label><label><span class="label-responsive"><?php _e('End date:', 'geodirectory'); ?></span><input type="text" id="gd_imex_end_date" name="gd_imex[end_date]" data-type="date" /></label></td>
|
|
| 2390 | 2390 | </tr> |
| 2391 | 2391 | <tr> |
| 2392 | 2392 | <td class="fld" style="vertical-align:top"><label> |
| 2393 | - <?php _e( 'Progress:', 'geodirectory' );?> |
|
| 2393 | + <?php _e('Progress:', 'geodirectory'); ?>
|
|
| 2394 | 2394 | </label></td> |
| 2395 | 2395 | <td><div id='gd_progressbar_box'> |
| 2396 | 2396 | <div id="gd_progressbar" class="gd_progressbar"> |
@@ -2398,13 +2398,13 @@ discard block |
||
| 2398 | 2398 | </div> |
| 2399 | 2399 | </div> |
| 2400 | 2400 | <p style="display:inline-block"> |
| 2401 | - <?php _e( 'Elapsed Time:', 'geodirectory' );?> |
|
| 2401 | + <?php _e('Elapsed Time:', 'geodirectory'); ?>
|
|
| 2402 | 2402 | </p> |
| 2403 | 2403 | |
| 2404 | 2404 | <p id="gd_timer" class="gd_timer">00:00:00</p></td> |
| 2405 | 2405 | </tr> |
| 2406 | 2406 | <tr class="gd-ie-actions"> |
| 2407 | - <td style="vertical-align:top"><input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_exposts_submit" id="gd_ie_exposts_submit"> |
|
| 2407 | + <td style="vertical-align:top"><input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_exposts_submit" id="gd_ie_exposts_submit">
|
|
| 2408 | 2408 | </td> |
| 2409 | 2409 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
| 2410 | 2410 | </tr> |
@@ -2417,21 +2417,21 @@ discard block |
||
| 2417 | 2417 | <div id="gd_ie_imcategs" class="metabox-holder"> |
| 2418 | 2418 | <div class="meta-box-sortables ui-sortable"> |
| 2419 | 2419 | <div id="gd_ie_imcats" class="postbox gd-hndle-pbox"> |
| 2420 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Categories: Import CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
| 2421 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Import CSV', 'geodirectory' );?></span></h3> |
|
| 2420 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Categories: Import CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
|
|
| 2421 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Import CSV', 'geodirectory'); ?></span></h3>
|
|
| 2422 | 2422 | <div class="inside"> |
| 2423 | 2423 | <table class="form-table"> |
| 2424 | 2424 | <tbody> |
| 2425 | 2425 | <tr> |
| 2426 | 2426 | <td class="gd-imex-box"> |
| 2427 | 2427 | <div class="gd-im-choices"> |
| 2428 | - <p><input type="radio" value="update" name="gd_im_choicecat" id="gd_im_cchoice_u" /><label for="gd_im_cchoice_u"><?php _e( 'Update item if item with cat_id/cat_slug already exists.', 'geodirectory' );?></label></p> |
|
| 2429 | - <p><input type="radio" checked="checked" value="skip" name="gd_im_choicecat" id="gd_im_cchoice_s" /><label for="gd_im_cchoice_s"><?php _e( 'Ignore item if item with cat_id/cat_slug already exists.', 'geodirectory' );?></label></p> |
|
| 2428 | + <p><input type="radio" value="update" name="gd_im_choicecat" id="gd_im_cchoice_u" /><label for="gd_im_cchoice_u"><?php _e('Update item if item with cat_id/cat_slug already exists.', 'geodirectory'); ?></label></p>
|
|
| 2429 | + <p><input type="radio" checked="checked" value="skip" name="gd_im_choicecat" id="gd_im_cchoice_s" /><label for="gd_im_cchoice_s"><?php _e('Ignore item if item with cat_id/cat_slug already exists.', 'geodirectory'); ?></label></p>
|
|
| 2430 | 2430 | </div> |
| 2431 | 2431 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_catplupload-upload-ui"> |
| 2432 | 2432 | <input type="text" readonly="readonly" name="gd_im_cat_file" class="gd-imex-file gd_im_cat_file" id="gd_im_cat" onclick="jQuery('#gd_im_catplupload-browse-button').trigger('click');" />
|
| 2433 | - <input id="gd_im_catplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-cupload button-primary" /><input type="button" value="<?php echo esc_attr( __( 'Download Sample CSV', 'geodirectory' ) );?>" class="button-secondary" name="gd_ie_imcats_sample" id="gd_ie_imcats_sample"> |
|
| 2434 | - <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv;?>" /> |
|
| 2433 | + <input id="gd_im_catplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-cupload button-primary" /><input type="button" value="<?php echo esc_attr(__('Download Sample CSV', 'geodirectory')); ?>" class="button-secondary" name="gd_ie_imcats_sample" id="gd_ie_imcats_sample">
|
|
| 2434 | + <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv; ?>" /> |
|
| 2435 | 2435 | <?php |
| 2436 | 2436 | /** |
| 2437 | 2437 | * Called just after the sample CSV download link. |
@@ -2441,7 +2441,7 @@ discard block |
||
| 2441 | 2441 | */ |
| 2442 | 2442 | do_action('geodir_sample_cats_csv_download_link');
|
| 2443 | 2443 | ?> |
| 2444 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_catpluploadan' ); ?>"></span> |
|
| 2444 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_catpluploadan'); ?>"></span>
|
|
| 2445 | 2445 | <div class="filelist"></div> |
| 2446 | 2446 | </div> |
| 2447 | 2447 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -2458,7 +2458,7 @@ discard block |
||
| 2458 | 2458 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
| 2459 | 2459 | </div> |
| 2460 | 2460 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
| 2461 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
|
|
| 2461 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
|
|
| 2462 | 2462 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
| 2463 | 2463 | id="gd-import-perc">0%</font> ) |
| 2464 | 2464 | <div class="gd-fileprogress"></div> |
@@ -2470,10 +2470,10 @@ discard block |
||
| 2470 | 2470 | <div class="gd-imex-btns" style="display:none;"> |
| 2471 | 2471 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
| 2472 | 2472 | <input onclick="gd_imex_PrepareImport(this, 'cat')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
| 2473 | - <input onclick="gd_imex_ContinueImport(this, 'cat')" type="button" value="<?php _e( "Continue Import Data", 'geodirectory' );?>" id="gd_continue_data" class="button-primary" style="display:none"/> |
|
| 2474 | - <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'cat')"/>
|
|
| 2473 | + <input onclick="gd_imex_ContinueImport(this, 'cat')" type="button" value="<?php _e("Continue Import Data", 'geodirectory'); ?>" id="gd_continue_data" class="button-primary" style="display:none"/>
|
|
| 2474 | + <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'cat')"/>
|
|
| 2475 | 2475 | <div id="gd_process_data" style="display:none"> |
| 2476 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
|
|
| 2476 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
|
|
| 2477 | 2477 | </div> |
| 2478 | 2478 | </div> |
| 2479 | 2479 | </td> |
@@ -2487,26 +2487,26 @@ discard block |
||
| 2487 | 2487 | <div id="gd_ie_excategs" class="metabox-holder"> |
| 2488 | 2488 | <div class="meta-box-sortables ui-sortable"> |
| 2489 | 2489 | <div id="gd_ie_ex_cats" class="postbox gd-hndle-pbox"> |
| 2490 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Categories: Export CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
| 2491 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Export CSV', 'geodirectory' );?></span></h3> |
|
| 2490 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Categories: Export CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
|
|
| 2491 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Export CSV', 'geodirectory'); ?></span></h3>
|
|
| 2492 | 2492 | <div class="inside"> |
| 2493 | 2493 | <table class="form-table"> |
| 2494 | 2494 | <tbody> |
| 2495 | 2495 | <tr> |
| 2496 | - <td class="fld"><label for="gd_post_type"><?php _e( 'Post Type:', 'geodirectory' );?></label></td> |
|
| 2497 | - <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option;?></select></td> |
|
| 2496 | + <td class="fld"><label for="gd_post_type"><?php _e('Post Type:', 'geodirectory'); ?></label></td>
|
|
| 2497 | + <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option; ?></select></td> |
|
| 2498 | 2498 | </tr> |
| 2499 | 2499 | <tr> |
| 2500 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
| 2501 | - <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option;?></select><span class="description"><?php _e( 'Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory' );?></span></td> |
|
| 2500 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td>
|
|
| 2501 | + <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option; ?></select><span class="description"><?php _e('Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory'); ?></span></td>
|
|
| 2502 | 2502 | </tr> |
| 2503 | 2503 | <tr> |
| 2504 | - <td class="fld" style="vertical-align:top"><label><?php _e( 'Progress:', 'geodirectory' );?></label></td> |
|
| 2505 | - <td><div id='gd_progressbar_box'><div id="gd_progressbar" class="gd_progressbar"><div class="gd-progress-label"></div></div></div><p style="display:inline-block"><?php _e( 'Elapsed Time:', 'geodirectory' );?></p> <p id="gd_timer" class="gd_timer">00:00:00</p></td> |
|
| 2504 | + <td class="fld" style="vertical-align:top"><label><?php _e('Progress:', 'geodirectory'); ?></label></td>
|
|
| 2505 | + <td><div id='gd_progressbar_box'><div id="gd_progressbar" class="gd_progressbar"><div class="gd-progress-label"></div></div></div><p style="display:inline-block"><?php _e('Elapsed Time:', 'geodirectory'); ?></p> <p id="gd_timer" class="gd_timer">00:00:00</p></td>
|
|
| 2506 | 2506 | </tr> |
| 2507 | 2507 | <tr class="gd-ie-actions"> |
| 2508 | 2508 | <td style="vertical-align:top"> |
| 2509 | - <input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit"> |
|
| 2509 | + <input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit">
|
|
| 2510 | 2510 | </td> |
| 2511 | 2511 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
| 2512 | 2512 | </tr> |
@@ -2528,7 +2528,7 @@ discard block |
||
| 2528 | 2528 | * @param array $gd_chunksize_options File chunk size options. |
| 2529 | 2529 | * @param string $nonce Wordpress security token for GD import & export. |
| 2530 | 2530 | */ |
| 2531 | - do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce ); |
|
| 2531 | + do_action('geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce);
|
|
| 2532 | 2532 | ?> |
| 2533 | 2533 | </div> |
| 2534 | 2534 | </div> |
@@ -2547,7 +2547,7 @@ discard block |
||
| 2547 | 2547 | jQuery.ajax({
|
| 2548 | 2548 | url: ajaxurl, |
| 2549 | 2549 | type: "POST", |
| 2550 | - data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce;?>', |
|
| 2550 | + data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce; ?>', |
|
| 2551 | 2551 | dataType: 'json', |
| 2552 | 2552 | cache: false, |
| 2553 | 2553 | success: function(data) {
|
@@ -2599,7 +2599,7 @@ discard block |
||
| 2599 | 2599 | |
| 2600 | 2600 | jQuery(cont).find('.filelist .file').remove();
|
| 2601 | 2601 | |
| 2602 | - jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr( PLZ_SELECT_CSV_FILE );?></p>");
|
|
| 2602 | + jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr(PLZ_SELECT_CSV_FILE); ?></p>");
|
|
| 2603 | 2603 | jQuery('#gd-import-msg', cont).show();
|
| 2604 | 2604 | |
| 2605 | 2605 | return false; |
@@ -2658,7 +2658,7 @@ discard block |
||
| 2658 | 2658 | jQuery.ajax({
|
| 2659 | 2659 | url: ajaxurl, |
| 2660 | 2660 | type: "POST", |
| 2661 | - data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce;?>', |
|
| 2661 | + data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce; ?>', |
|
| 2662 | 2662 | dataType : 'json', |
| 2663 | 2663 | cache: false, |
| 2664 | 2664 | success: function (data) {
|
@@ -2847,27 +2847,27 @@ discard block |
||
| 2847 | 2847 | |
| 2848 | 2848 | var gdMsg = '<p></p>'; |
| 2849 | 2849 | if ( processed > 0 ) {
|
| 2850 | - var msgParse = '<p><?php echo addslashes( sprintf( __( 'Total %s item(s) found.', 'geodirectory' ), '%s' ) );?></p>'; |
|
| 2850 | + var msgParse = '<p><?php echo addslashes(sprintf(__('Total %s item(s) found.', 'geodirectory'), '%s')); ?></p>';
|
|
| 2851 | 2851 | msgParse = msgParse.replace("%s", processed);
|
| 2852 | 2852 | gdMsg += msgParse; |
| 2853 | 2853 | } |
| 2854 | 2854 | |
| 2855 | 2855 | if ( updated > 0 ) {
|
| 2856 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) updated.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 2856 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) updated.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 2857 | 2857 | msgParse = msgParse.replace("%s", updated);
|
| 2858 | 2858 | msgParse = msgParse.replace("%d", processed);
|
| 2859 | 2859 | gdMsg += msgParse; |
| 2860 | 2860 | } |
| 2861 | 2861 | |
| 2862 | 2862 | if ( created > 0 ) {
|
| 2863 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) added.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 2863 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) added.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 2864 | 2864 | msgParse = msgParse.replace("%s", created);
|
| 2865 | 2865 | msgParse = msgParse.replace("%d", processed);
|
| 2866 | 2866 | gdMsg += msgParse; |
| 2867 | 2867 | } |
| 2868 | 2868 | |
| 2869 | 2869 | if ( skipped > 0 ) {
|
| 2870 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) ignored due to already exists.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 2870 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) ignored due to already exists.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 2871 | 2871 | msgParse = msgParse.replace("%s", skipped);
|
| 2872 | 2872 | msgParse = msgParse.replace("%d", processed);
|
| 2873 | 2873 | gdMsg += msgParse; |
@@ -2877,17 +2877,17 @@ discard block |
||
| 2877 | 2877 | if (type=='loc') {
|
| 2878 | 2878 | invalid_addr = invalid; |
| 2879 | 2879 | } |
| 2880 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 2880 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 2881 | 2881 | msgParse = msgParse.replace("%s", invalid_addr);
|
| 2882 | 2882 | msgParse = msgParse.replace("%d", total);
|
| 2883 | 2883 | gdMsg += msgParse; |
| 2884 | 2884 | } |
| 2885 | 2885 | |
| 2886 | 2886 | if (invalid > 0 && type!='loc') {
|
| 2887 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank title/invalid post type/invalid characters used in data.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 2887 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank title/invalid post type/invalid characters used in data.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 2888 | 2888 | |
| 2889 | 2889 | if (type=='hood') {
|
| 2890 | - msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 2890 | + msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 2891 | 2891 | } |
| 2892 | 2892 | msgParse = msgParse.replace("%s", invalid);
|
| 2893 | 2893 | msgParse = msgParse.replace("%d", total);
|
@@ -2895,7 +2895,7 @@ discard block |
||
| 2895 | 2895 | } |
| 2896 | 2896 | |
| 2897 | 2897 | if (images > 0) {
|
| 2898 | - gdMsg += '<p><?php echo addslashes( sprintf( CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'] ) );?></p>'; |
|
| 2898 | + gdMsg += '<p><?php echo addslashes(sprintf(CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'])); ?></p>'; |
|
| 2899 | 2899 | } |
| 2900 | 2900 | gdMsg += '<p></p>'; |
| 2901 | 2901 | jQuery('#gd-import-msg', cont).find('#message').removeClass('error').addClass('updated').html(gdMsg);
|
@@ -3059,9 +3059,9 @@ discard block |
||
| 3059 | 3059 | if (typeof filters !== 'undefined' && filters && doFilter) {
|
| 3060 | 3060 | getTotal = true; |
| 3061 | 3061 | attach += '&_c=1'; |
| 3062 | - gd_progressbar(el, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Preparing...', 'geodirectory' ) );?>'); |
|
| 3062 | + gd_progressbar(el, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Preparing...', 'geodirectory')); ?>');
|
|
| 3063 | 3063 | } else {
|
| 3064 | - gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
| 3064 | + gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
|
|
| 3065 | 3065 | } |
| 3066 | 3066 | jQuery(el).find('#gd_timer').text('00:00:01');
|
| 3067 | 3067 | jQuery('#gd_ie_ex_files', el).html('');
|
@@ -3070,7 +3070,7 @@ discard block |
||
| 3070 | 3070 | jQuery.ajax({
|
| 3071 | 3071 | url: ajaxurl, |
| 3072 | 3072 | type: "POST", |
| 3073 | - data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page + attach, |
|
| 3073 | + data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page + attach, |
|
| 3074 | 3074 | dataType : 'json', |
| 3075 | 3075 | cache: false, |
| 3076 | 3076 | beforeSend: function (jqXHR, settings) {},
|
@@ -3095,11 +3095,11 @@ discard block |
||
| 3095 | 3095 | } else {
|
| 3096 | 3096 | if (pages < page || pages == page) {
|
| 3097 | 3097 | window.clearInterval(timer_posts); |
| 3098 | - gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>');
|
|
| 3098 | + gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>');
|
|
| 3099 | 3099 | } else {
|
| 3100 | 3100 | var percentage = Math.round(((page * chunk_size) / total_posts) * 100); |
| 3101 | 3101 | percentage = percentage > 100 ? 100 : percentage; |
| 3102 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>');
|
|
| 3102 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
|
|
| 3103 | 3103 | } |
| 3104 | 3104 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) {
|
| 3105 | 3105 | var obj_files = data.files; |
@@ -3130,7 +3130,7 @@ discard block |
||
| 3130 | 3130 | |
| 3131 | 3131 | function gd_process_export_cats(el, post_type, total_cats, chunk_size, pages, page) {
|
| 3132 | 3132 | if (page < 2) {
|
| 3133 | - gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
| 3133 | + gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
|
|
| 3134 | 3134 | jQuery(el).find('#gd_timer').text('00:00:01');
|
| 3135 | 3135 | jQuery('#gd_ie_ex_files', el).html('');
|
| 3136 | 3136 | } |
@@ -3138,7 +3138,7 @@ discard block |
||
| 3138 | 3138 | jQuery.ajax({
|
| 3139 | 3139 | url: ajaxurl, |
| 3140 | 3140 | type: "POST", |
| 3141 | - data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page, |
|
| 3141 | + data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page, |
|
| 3142 | 3142 | dataType : 'json', |
| 3143 | 3143 | cache: false, |
| 3144 | 3144 | beforeSend: function (jqXHR, settings) {},
|
@@ -3152,11 +3152,11 @@ discard block |
||
| 3152 | 3152 | } else {
|
| 3153 | 3153 | if (pages < page || pages == page) {
|
| 3154 | 3154 | window.clearInterval(timer_cats); |
| 3155 | - gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>');
|
|
| 3155 | + gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>');
|
|
| 3156 | 3156 | } else {
|
| 3157 | 3157 | var percentage = Math.round(((page * chunk_size) / total_cats) * 100); |
| 3158 | 3158 | percentage = percentage > 100 ? 100 : percentage; |
| 3159 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e( 'Exporting...', 'geodirectory' );?>');
|
|
| 3159 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e('Exporting...', 'geodirectory'); ?>');
|
|
| 3160 | 3160 | } |
| 3161 | 3161 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) {
|
| 3162 | 3162 | var obj_files = data.files; |
@@ -3213,13 +3213,13 @@ discard block |
||
| 3213 | 3213 | function geodir_init_filesystem() |
| 3214 | 3214 | {
|
| 3215 | 3215 | |
| 3216 | - if(!function_exists('get_filesystem_method')){
|
|
| 3216 | + if (!function_exists('get_filesystem_method')) {
|
|
| 3217 | 3217 | require_once(ABSPATH."/wp-admin/includes/file.php"); |
| 3218 | 3218 | } |
| 3219 | 3219 | $access_type = get_filesystem_method(); |
| 3220 | 3220 | if ($access_type === 'direct') {
|
| 3221 | 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()); |
|
| 3222 | + $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array()); |
|
| 3223 | 3223 | |
| 3224 | 3224 | /* initialize the API */ |
| 3225 | 3225 | if (!WP_Filesystem($creds)) {
|
@@ -3232,7 +3232,7 @@ discard block |
||
| 3232 | 3232 | return $wp_filesystem; |
| 3233 | 3233 | /* do our file manipulations below */ |
| 3234 | 3234 | } elseif (defined('FTP_USER')) {
|
| 3235 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
| 3235 | + $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array()); |
|
| 3236 | 3236 | |
| 3237 | 3237 | /* initialize the API */ |
| 3238 | 3238 | if (!WP_Filesystem($creds)) {
|
@@ -3267,7 +3267,7 @@ discard block |
||
| 3267 | 3267 | * @package GeoDirectory |
| 3268 | 3268 | */ |
| 3269 | 3269 | function geodir_filesystem_notice() |
| 3270 | -{ if ( defined( 'DOING_AJAX' ) ){return;}
|
|
| 3270 | +{ if (defined('DOING_AJAX')) {return; }
|
|
| 3271 | 3271 | $access_type = get_filesystem_method(); |
| 3272 | 3272 | if ($access_type === 'direct') {
|
| 3273 | 3273 | } elseif (!defined('FTP_USER')) {
|
@@ -3304,64 +3304,64 @@ discard block |
||
| 3304 | 3304 | // try to set higher limits for import |
| 3305 | 3305 | $max_input_time = ini_get('max_input_time');
|
| 3306 | 3306 | $max_execution_time = ini_get('max_execution_time');
|
| 3307 | - $memory_limit= ini_get('memory_limit');
|
|
| 3307 | + $memory_limit = ini_get('memory_limit');
|
|
| 3308 | 3308 | |
| 3309 | - if(!$max_input_time || $max_input_time<3000){
|
|
| 3309 | + if (!$max_input_time || $max_input_time < 3000) {
|
|
| 3310 | 3310 | ini_set('max_input_time', 3000);
|
| 3311 | 3311 | } |
| 3312 | 3312 | |
| 3313 | - if(!$max_execution_time || $max_execution_time<3000){
|
|
| 3313 | + if (!$max_execution_time || $max_execution_time < 3000) {
|
|
| 3314 | 3314 | ini_set('max_execution_time', 3000);
|
| 3315 | 3315 | } |
| 3316 | 3316 | |
| 3317 | - if($memory_limit && str_replace('M','',$memory_limit)){
|
|
| 3318 | - if(str_replace('M','',$memory_limit)<256){
|
|
| 3317 | + if ($memory_limit && str_replace('M', '', $memory_limit)) {
|
|
| 3318 | + if (str_replace('M', '', $memory_limit) < 256) {
|
|
| 3319 | 3319 | ini_set('memory_limit', '256M');
|
| 3320 | 3320 | } |
| 3321 | 3321 | } |
| 3322 | 3322 | |
| 3323 | 3323 | $json = array(); |
| 3324 | 3324 | |
| 3325 | - if ( !current_user_can( 'manage_options' ) ) {
|
|
| 3326 | - wp_send_json( $json ); |
|
| 3325 | + if (!current_user_can('manage_options')) {
|
|
| 3326 | + wp_send_json($json); |
|
| 3327 | 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 ); |
|
| 3333 | + if (!wp_verify_nonce($nonce, 'geodir_import_export_nonce')) {
|
|
| 3334 | + wp_send_json($json); |
|
| 3335 | 3335 | } |
| 3336 | 3336 | |
| 3337 | - $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL; |
|
| 3338 | - $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL; |
|
| 3337 | + $post_type = isset($_REQUEST['_pt']) ? $_REQUEST['_pt'] : NULL; |
|
| 3338 | + $chunk_per_page = isset($_REQUEST['_n']) ? absint($_REQUEST['_n']) : NULL; |
|
| 3339 | 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; |
|
| 3340 | + $chunk_page_no = isset($_REQUEST['_p']) ? absint($_REQUEST['_p']) : 1; |
|
| 3341 | 3341 | |
| 3342 | 3342 | $wp_filesystem = geodir_init_filesystem(); |
| 3343 | 3343 | if (!$wp_filesystem) {
|
| 3344 | - $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' ); |
|
| 3345 | - wp_send_json( $json ); |
|
| 3344 | + $json['error'] = __('Filesystem ERROR: Could not access filesystem.', 'geodirectory');
|
|
| 3345 | + wp_send_json($json); |
|
| 3346 | 3346 | } |
| 3347 | 3347 | |
| 3348 | 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 ); |
|
| 3349 | + $json['error'] = __('Filesystem ERROR: '.$wp_filesystem->errors->get_error_message(), 'geodirectory');
|
|
| 3350 | + wp_send_json($json); |
|
| 3351 | 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 ); |
|
| 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 | 3358 | } |
| 3359 | 3359 | } |
| 3360 | 3360 | |
| 3361 | 3361 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
|
| 3362 | 3362 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
|
| 3363 | 3363 | |
| 3364 | - switch ( $task ) {
|
|
| 3364 | + switch ($task) {
|
|
| 3365 | 3365 | case 'export_posts': {
|
| 3366 | 3366 | // WPML |
| 3367 | 3367 | $is_wpml = geodir_is_wpml(); |
@@ -3372,36 +3372,36 @@ discard block |
||
| 3372 | 3372 | $sitepress->switch_lang('all', true);
|
| 3373 | 3373 | } |
| 3374 | 3374 | // WPML |
| 3375 | - if ( $post_type == 'gd_event' ) {
|
|
| 3376 | - add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 ); |
|
| 3375 | + if ($post_type == 'gd_event') {
|
|
| 3376 | + add_filter('geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2);
|
|
| 3377 | 3377 | } |
| 3378 | - $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
| 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'] ) ); |
|
| 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 | 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'; |
|
| 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 | 3390 | $chunk_file_paths = array(); |
| 3391 | 3391 | |
| 3392 | - if ( isset( $_REQUEST['_c'] ) ) {
|
|
| 3392 | + if (isset($_REQUEST['_c'])) {
|
|
| 3393 | 3393 | $json['total'] = $posts_count; |
| 3394 | 3394 | // WPML |
| 3395 | 3395 | if ($is_wpml) {
|
| 3396 | 3396 | $sitepress->switch_lang($active_lang, true); |
| 3397 | 3397 | } |
| 3398 | 3398 | // WPML |
| 3399 | - wp_send_json( $json ); |
|
| 3399 | + wp_send_json($json); |
|
| 3400 | 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 ); |
|
| 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 | 3406 | $json['percentage'] = $percentage; |
| 3407 | 3407 | // WPML |
@@ -3409,45 +3409,45 @@ discard block |
||
| 3409 | 3409 | $sitepress->switch_lang($active_lang, true); |
| 3410 | 3410 | } |
| 3411 | 3411 | // WPML |
| 3412 | - wp_send_json( $json ); |
|
| 3412 | + wp_send_json($json); |
|
| 3413 | 3413 | gd_die(); |
| 3414 | 3414 | } else {
|
| 3415 | - if ( !$posts_count > 0 ) {
|
|
| 3416 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3415 | + if (!$posts_count > 0) {
|
|
| 3416 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 3417 | 3417 | } else {
|
| 3418 | 3418 | $total_posts = $posts_count; |
| 3419 | 3419 | if ($chunk_per_page > $total_posts) {
|
| 3420 | 3420 | $chunk_per_page = $total_posts; |
| 3421 | 3421 | } |
| 3422 | - $chunk_total_pages = ceil( $total_posts / $chunk_per_page ); |
|
| 3422 | + $chunk_total_pages = ceil($total_posts / $chunk_per_page); |
|
| 3423 | 3423 | |
| 3424 | 3424 | $j = $chunk_page_no; |
| 3425 | - $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j ); |
|
| 3425 | + $chunk_save_posts = geodir_imex_get_posts($post_type, $chunk_per_page, $j); |
|
| 3426 | 3426 | |
| 3427 | 3427 | $per_page = 500; |
| 3428 | 3428 | if ($per_page > $chunk_per_page) {
|
| 3429 | 3429 | $per_page = $chunk_per_page; |
| 3430 | 3430 | } |
| 3431 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 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 | 3436 | $clear = $i == 0 ? true : false; |
| 3437 | - geodir_save_csv_data( $file_path_temp, $save_posts, $clear ); |
|
| 3437 | + geodir_save_csv_data($file_path_temp, $save_posts, $clear); |
|
| 3438 | 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));
|
|
| 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 | 3448 | } |
| 3449 | 3449 | |
| 3450 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3450 | + if (!empty($chunk_file_paths)) {
|
|
| 3451 | 3451 | $json['total'] = $posts_count; |
| 3452 | 3452 | $json['files'] = $chunk_file_paths; |
| 3453 | 3453 | } else {
|
@@ -3455,7 +3455,7 @@ discard block |
||
| 3455 | 3455 | $json['total'] = $posts_count; |
| 3456 | 3456 | $json['files'] = array(); |
| 3457 | 3457 | } else {
|
| 3458 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3458 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory');
|
|
| 3459 | 3459 | } |
| 3460 | 3460 | } |
| 3461 | 3461 | } |
@@ -3464,7 +3464,7 @@ discard block |
||
| 3464 | 3464 | $sitepress->switch_lang($active_lang, true); |
| 3465 | 3465 | } |
| 3466 | 3466 | // WPML |
| 3467 | - wp_send_json( $json ); |
|
| 3467 | + wp_send_json($json); |
|
| 3468 | 3468 | } |
| 3469 | 3469 | } |
| 3470 | 3470 | break; |
@@ -3478,20 +3478,20 @@ discard block |
||
| 3478 | 3478 | $sitepress->switch_lang('all', true);
|
| 3479 | 3479 | } |
| 3480 | 3480 | // WPML |
| 3481 | - $file_name = $post_type . 'category_' . date( 'dmyHi' ); |
|
| 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 | 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 | 3496 | $json['percentage'] = $percentage; |
| 3497 | 3497 | // WPML |
@@ -3499,48 +3499,48 @@ discard block |
||
| 3499 | 3499 | $sitepress->switch_lang($active_lang, true); |
| 3500 | 3500 | } |
| 3501 | 3501 | // WPML |
| 3502 | - wp_send_json( $json ); |
|
| 3502 | + wp_send_json($json); |
|
| 3503 | 3503 | } else {
|
| 3504 | - if ( !$terms_count > 0 ) {
|
|
| 3505 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3504 | + if (!$terms_count > 0) {
|
|
| 3505 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 3506 | 3506 | } else {
|
| 3507 | 3507 | $total_terms = $terms_count; |
| 3508 | 3508 | if ($chunk_per_page > $terms_count) {
|
| 3509 | 3509 | $chunk_per_page = $terms_count; |
| 3510 | 3510 | } |
| 3511 | - $chunk_total_pages = ceil( $total_terms / $chunk_per_page ); |
|
| 3511 | + $chunk_total_pages = ceil($total_terms / $chunk_per_page); |
|
| 3512 | 3512 | |
| 3513 | 3513 | $j = $chunk_page_no; |
| 3514 | - $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j ); |
|
| 3514 | + $chunk_save_terms = geodir_imex_get_terms($post_type, $chunk_per_page, $j); |
|
| 3515 | 3515 | |
| 3516 | 3516 | $per_page = 500; |
| 3517 | 3517 | if ($per_page > $chunk_per_page) {
|
| 3518 | 3518 | $per_page = $chunk_per_page; |
| 3519 | 3519 | } |
| 3520 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 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 | 3525 | $clear = $i == 0 ? true : false; |
| 3526 | - geodir_save_csv_data( $file_path_temp, $save_terms, $clear ); |
|
| 3526 | + geodir_save_csv_data($file_path_temp, $save_terms, $clear); |
|
| 3527 | 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));
|
|
| 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 | 3537 | } |
| 3538 | 3538 | |
| 3539 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3539 | + if (!empty($chunk_file_paths)) {
|
|
| 3540 | 3540 | $json['total'] = $terms_count; |
| 3541 | 3541 | $json['files'] = $chunk_file_paths; |
| 3542 | 3542 | } else {
|
| 3543 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 3543 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory');
|
|
| 3544 | 3544 | } |
| 3545 | 3545 | } |
| 3546 | 3546 | // WPML |
@@ -3548,127 +3548,127 @@ discard block |
||
| 3548 | 3548 | $sitepress->switch_lang($active_lang, true); |
| 3549 | 3549 | } |
| 3550 | 3550 | // WPML |
| 3551 | - wp_send_json( $json ); |
|
| 3551 | + wp_send_json($json); |
|
| 3552 | 3552 | } |
| 3553 | 3553 | } |
| 3554 | 3554 | break; |
| 3555 | 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'; |
|
| 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 | 3569 | $json['percentage'] = $percentage; |
| 3570 | - wp_send_json( $json ); |
|
| 3570 | + wp_send_json($json); |
|
| 3571 | 3571 | } else {
|
| 3572 | 3572 | $chunk_file_paths = array(); |
| 3573 | 3573 | |
| 3574 | - if ( !$items_count > 0 ) {
|
|
| 3575 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3574 | + if (!$items_count > 0) {
|
|
| 3575 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 3576 | 3576 | } else {
|
| 3577 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 3578 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 3577 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
| 3578 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
| 3579 | 3579 | |
| 3580 | 3580 | $j = $chunk_page_no; |
| 3581 | - $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j ); |
|
| 3581 | + $chunk_save_items = geodir_location_imex_locations_data($chunk_per_page, $j); |
|
| 3582 | 3582 | |
| 3583 | 3583 | $per_page = 500; |
| 3584 | - $per_page = min( $per_page, $chunk_per_page ); |
|
| 3585 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 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 | 3590 | $clear = $i == 0 ? true : false; |
| 3591 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 3591 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
| 3592 | 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));
|
|
| 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 | 3602 | } |
| 3603 | 3603 | |
| 3604 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3604 | + if (!empty($chunk_file_paths)) {
|
|
| 3605 | 3605 | $json['total'] = $items_count; |
| 3606 | 3606 | $json['files'] = $chunk_file_paths; |
| 3607 | 3607 | } else {
|
| 3608 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 3608 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory');
|
|
| 3609 | 3609 | } |
| 3610 | 3610 | } |
| 3611 | - wp_send_json( $json ); |
|
| 3611 | + wp_send_json($json); |
|
| 3612 | 3612 | } |
| 3613 | 3613 | } |
| 3614 | 3614 | break; |
| 3615 | 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'; |
|
| 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 | 3629 | $json['percentage'] = $percentage; |
| 3630 | - wp_send_json( $json ); |
|
| 3630 | + wp_send_json($json); |
|
| 3631 | 3631 | } else {
|
| 3632 | 3632 | $chunk_file_paths = array(); |
| 3633 | 3633 | |
| 3634 | - if ( !$items_count > 0 ) {
|
|
| 3635 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 3634 | + if (!$items_count > 0) {
|
|
| 3635 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 3636 | 3636 | } else {
|
| 3637 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 3638 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 3637 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
| 3638 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
| 3639 | 3639 | |
| 3640 | 3640 | $j = $chunk_page_no; |
| 3641 | - $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j ); |
|
| 3641 | + $chunk_save_items = geodir_location_imex_neighbourhoods_data($chunk_per_page, $j); |
|
| 3642 | 3642 | |
| 3643 | 3643 | $per_page = 500; |
| 3644 | - $per_page = min( $per_page, $chunk_per_page ); |
|
| 3645 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 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 | 3650 | $clear = $i == 0 ? true : false; |
| 3651 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 3651 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
| 3652 | 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));
|
|
| 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 | 3662 | } |
| 3663 | 3663 | |
| 3664 | - if ( !empty($chunk_file_paths) ) {
|
|
| 3664 | + if (!empty($chunk_file_paths)) {
|
|
| 3665 | 3665 | $json['total'] = $items_count; |
| 3666 | 3666 | $json['files'] = $chunk_file_paths; |
| 3667 | 3667 | } else {
|
| 3668 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 3668 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory');
|
|
| 3669 | 3669 | } |
| 3670 | 3670 | } |
| 3671 | - wp_send_json( $json ); |
|
| 3671 | + wp_send_json($json); |
|
| 3672 | 3672 | } |
| 3673 | 3673 | } |
| 3674 | 3674 | break; |
@@ -3685,25 +3685,25 @@ discard block |
||
| 3685 | 3685 | } |
| 3686 | 3686 | // WPML |
| 3687 | 3687 | |
| 3688 | - ini_set( 'auto_detect_line_endings', true ); |
|
| 3688 | + ini_set('auto_detect_line_endings', true);
|
|
| 3689 | 3689 | |
| 3690 | 3690 | $uploads = wp_upload_dir(); |
| 3691 | 3691 | $uploads_dir = $uploads['path']; |
| 3692 | 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 | 3701 | $json['file'] = $csv_file; |
| 3702 | - $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' ); |
|
| 3702 | + $json['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
|
|
| 3703 | 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 | 3708 | if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
|
| 3709 | 3709 | $json['error'] = NULL; |
@@ -3711,9 +3711,9 @@ discard block |
||
| 3711 | 3711 | |
| 3712 | 3712 | $lc_all = setlocale(LC_ALL, 0); // Fix issue of fgetcsv ignores special characters when they are at the beginning of line |
| 3713 | 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 ) ) {
|
|
| 3714 | + if (($handle = fopen($target_path, "r")) !== FALSE) {
|
|
| 3715 | + while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) {
|
|
| 3716 | + if (!empty($data)) {
|
|
| 3717 | 3717 | $file[] = $data; |
| 3718 | 3718 | } |
| 3719 | 3719 | } |
@@ -3727,19 +3727,19 @@ discard block |
||
| 3727 | 3727 | $json['error'] = __('No data found in csv file.', 'geodirectory');
|
| 3728 | 3728 | } |
| 3729 | 3729 | } else {
|
| 3730 | - wp_send_json( $json ); |
|
| 3730 | + wp_send_json($json); |
|
| 3731 | 3731 | } |
| 3732 | 3732 | } else {
|
| 3733 | - wp_send_json( $json ); |
|
| 3733 | + wp_send_json($json); |
|
| 3734 | 3734 | } |
| 3735 | 3735 | |
| 3736 | - if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
|
|
| 3737 | - wp_send_json( $json ); |
|
| 3736 | + if ($task == 'prepare_import' || !empty($json['error'])) {
|
|
| 3737 | + wp_send_json($json); |
|
| 3738 | 3738 | } |
| 3739 | 3739 | |
| 3740 | 3740 | $total = $json['rows']; |
| 3741 | - $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1; |
|
| 3742 | - $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0; |
|
| 3741 | + $limit = isset($_POST['limit']) ? (int) $_POST['limit'] : 1; |
|
| 3742 | + $processed = isset($_POST['processed']) ? (int) $_POST['processed'] : 0; |
|
| 3743 | 3743 | |
| 3744 | 3744 | $count = $limit; |
| 3745 | 3745 | |
@@ -3764,13 +3764,13 @@ discard block |
||
| 3764 | 3764 | |
| 3765 | 3765 | $post_types = geodir_get_posttypes(); |
| 3766 | 3766 | |
| 3767 | - if ( $task == 'import_cat' ) {
|
|
| 3767 | + if ($task == 'import_cat') {
|
|
| 3768 | 3768 | if (!empty($file)) {
|
| 3769 | 3769 | $columns = isset($file[0]) ? $file[0] : NULL; |
| 3770 | 3770 | |
| 3771 | 3771 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 3772 | 3772 | $json['error'] = CSV_INVAILD_FILE; |
| 3773 | - wp_send_json( $json ); |
|
| 3773 | + wp_send_json($json); |
|
| 3774 | 3774 | exit; |
| 3775 | 3775 | } |
| 3776 | 3776 | |
@@ -3781,7 +3781,7 @@ discard block |
||
| 3781 | 3781 | |
| 3782 | 3782 | if (isset($file[$index])) {
|
| 3783 | 3783 | $row = $file[$index]; |
| 3784 | - $row = array_map( 'trim', $row ); |
|
| 3784 | + $row = array_map('trim', $row);
|
|
| 3785 | 3785 | //$row = array_map( 'utf8_encode', $row ); |
| 3786 | 3786 | |
| 3787 | 3787 | $cat_id = ''; |
@@ -3798,42 +3798,42 @@ discard block |
||
| 3798 | 3798 | $cat_id_original = ''; |
| 3799 | 3799 | |
| 3800 | 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' ) {
|
|
| 3801 | + foreach ($columns as $column) {
|
|
| 3802 | + if ($column == 'cat_id') {
|
|
| 3803 | + $cat_id = (int) $row[$c]; |
|
| 3804 | + } else if ($column == 'cat_name') {
|
|
| 3805 | 3805 | $cat_name = $row[$c]; |
| 3806 | - } else if ( $column == 'cat_slug' ) {
|
|
| 3806 | + } else if ($column == 'cat_slug') {
|
|
| 3807 | 3807 | $cat_slug = $row[$c]; |
| 3808 | - } else if ( $column == 'cat_posttype' ) {
|
|
| 3808 | + } else if ($column == 'cat_posttype') {
|
|
| 3809 | 3809 | $cat_posttype = $row[$c]; |
| 3810 | - } else if ( $column == 'cat_parent' ) {
|
|
| 3810 | + } else if ($column == 'cat_parent') {
|
|
| 3811 | 3811 | $cat_parent = trim($row[$c]); |
| 3812 | - } else if ( $column == 'cat_schema' && $row[$c] != '' ) {
|
|
| 3812 | + } else if ($column == 'cat_schema' && $row[$c] != '') {
|
|
| 3813 | 3813 | $cat_schema = $row[$c]; |
| 3814 | - } else if ( $column == 'cat_description' ) {
|
|
| 3814 | + } else if ($column == 'cat_description') {
|
|
| 3815 | 3815 | $cat_description = $row[$c]; |
| 3816 | - } else if ( $column == 'cat_top_description' ) {
|
|
| 3816 | + } else if ($column == 'cat_top_description') {
|
|
| 3817 | 3817 | $cat_top_description = $row[$c]; |
| 3818 | - } else if ( $column == 'cat_image' ) {
|
|
| 3818 | + } else if ($column == 'cat_image') {
|
|
| 3819 | 3819 | $cat_image = $row[$c]; |
| 3820 | - } else if ( $column == 'cat_icon' ) {
|
|
| 3820 | + } else if ($column == 'cat_icon') {
|
|
| 3821 | 3821 | $cat_icon = $row[$c]; |
| 3822 | 3822 | } |
| 3823 | 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]; |
|
| 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 | 3829 | } |
| 3830 | 3830 | } |
| 3831 | 3831 | // WPML |
| 3832 | 3832 | $c++; |
| 3833 | 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 | 3838 | $invalid++; |
| 3839 | 3839 | continue; |
@@ -3851,24 +3851,24 @@ discard block |
||
| 3851 | 3851 | $term_data['description'] = $cat_description; |
| 3852 | 3852 | $term_data['cat_schema'] = $cat_schema; |
| 3853 | 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 ) : ''; |
|
| 3854 | + $term_data['image'] = $cat_image != '' ? basename($cat_image) : ''; |
|
| 3855 | + $term_data['icon'] = $cat_icon != '' ? basename($cat_icon) : ''; |
|
| 3856 | 3856 | |
| 3857 | 3857 | //$term_data = array_map( 'utf8_encode', $term_data ); |
| 3858 | 3858 | |
| 3859 | - $taxonomy = $cat_posttype . 'category'; |
|
| 3859 | + $taxonomy = $cat_posttype.'category'; |
|
| 3860 | 3860 | |
| 3861 | 3861 | $term_data['taxonomy'] = $taxonomy; |
| 3862 | 3862 | |
| 3863 | 3863 | $term_parent_id = 0; |
| 3864 | - if ($cat_parent != "" || (int)$cat_parent > 0) {
|
|
| 3864 | + if ($cat_parent != "" || (int) $cat_parent > 0) {
|
|
| 3865 | 3865 | $term_parent = ''; |
| 3866 | 3866 | |
| 3867 | - if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
|
|
| 3867 | + if ($term_parent = get_term_by('name', $cat_parent, $taxonomy)) {
|
|
| 3868 | 3868 | // |
| 3869 | - } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
|
|
| 3869 | + } else if ($term_parent = get_term_by('slug', $cat_parent, $taxonomy)) {
|
|
| 3870 | 3870 | // |
| 3871 | - } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
|
|
| 3871 | + } else if ($term_parent = get_term_by('id', $cat_parent, $taxonomy)) {
|
|
| 3872 | 3872 | // |
| 3873 | 3873 | } else {
|
| 3874 | 3874 | $term_parent_data = array(); |
@@ -3876,104 +3876,104 @@ discard block |
||
| 3876 | 3876 | //$term_parent_data = array_map( 'utf8_encode', $term_parent_data ); |
| 3877 | 3877 | $term_parent_data['taxonomy'] = $taxonomy; |
| 3878 | 3878 | |
| 3879 | - $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data ); |
|
| 3879 | + $term_parent_id = (int) geodir_imex_insert_term($taxonomy, $term_parent_data); |
|
| 3880 | 3880 | } |
| 3881 | 3881 | |
| 3882 | - if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
|
|
| 3883 | - $term_parent_id = (int)$term_parent->term_id; |
|
| 3882 | + if (!empty($term_parent) && !is_wp_error($term_parent)) {
|
|
| 3883 | + $term_parent_id = (int) $term_parent->term_id; |
|
| 3884 | 3884 | } |
| 3885 | 3885 | } |
| 3886 | - $term_data['parent'] = (int)$term_parent_id; |
|
| 3886 | + $term_data['parent'] = (int) $term_parent_id; |
|
| 3887 | 3887 | |
| 3888 | 3888 | $term_id = NULL; |
| 3889 | - if ( $import_choice == 'update' ) {
|
|
| 3890 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 3889 | + if ($import_choice == 'update') {
|
|
| 3890 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) {
|
|
| 3891 | 3891 | $term_data['term_id'] = $term['term_id']; |
| 3892 | 3892 | |
| 3893 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 3893 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) {
|
|
| 3894 | 3894 | $updated++; |
| 3895 | 3895 | } else {
|
| 3896 | 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' ) ); |
|
| 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 | 3898 | } |
| 3899 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 3899 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) {
|
|
| 3900 | 3900 | $term_data['term_id'] = $term['term_id']; |
| 3901 | 3901 | |
| 3902 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 3902 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) {
|
|
| 3903 | 3903 | $updated++; |
| 3904 | 3904 | } else {
|
| 3905 | 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' ) ); |
|
| 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 | 3907 | } |
| 3908 | 3908 | } else {
|
| 3909 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 3909 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) {
|
|
| 3910 | 3910 | $created++; |
| 3911 | 3911 | } else {
|
| 3912 | 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' ) ); |
|
| 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 | 3914 | } |
| 3915 | 3915 | } |
| 3916 | - } else if ( $import_choice == 'skip' ) {
|
|
| 3917 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 3916 | + } else if ($import_choice == 'skip') {
|
|
| 3917 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) {
|
|
| 3918 | 3918 | $skipped++; |
| 3919 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 3919 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) {
|
|
| 3920 | 3920 | $skipped++; |
| 3921 | 3921 | } else {
|
| 3922 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 3922 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) {
|
|
| 3923 | 3923 | $created++; |
| 3924 | 3924 | } else {
|
| 3925 | 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' ) ); |
|
| 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 | 3927 | } |
| 3928 | 3928 | } |
| 3929 | 3929 | } else {
|
| 3930 | 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' ) ); |
|
| 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 | 3932 | } |
| 3933 | 3933 | |
| 3934 | - if ( $term_id ) {
|
|
| 3934 | + if ($term_id) {
|
|
| 3935 | 3935 | // WPML |
| 3936 | 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 ); |
|
| 3937 | + $wpml_element_type = 'tax_'.$taxonomy; |
|
| 3938 | + $source_language = geodir_get_language_for_element($cat_id_original, $wpml_element_type); |
|
| 3939 | 3939 | $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
| 3940 | 3940 | |
| 3941 | - $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type ); |
|
| 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 ); |
|
| 3943 | + $sitepress->set_element_language_details($term_id, $wpml_element_type, $trid, $cat_language, $source_language); |
|
| 3944 | 3944 | } |
| 3945 | 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 ); |
|
| 3947 | + if (isset($term_data['top_description'])) {
|
|
| 3948 | + update_tax_meta($term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype); |
|
| 3949 | 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 ); |
|
| 3951 | + if (isset($term_data['cat_schema'])) {
|
|
| 3952 | + update_tax_meta($term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype); |
|
| 3953 | 3953 | } |
| 3954 | 3954 | |
| 3955 | 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'] : ''; |
|
| 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'] ) {
|
|
| 3960 | + if (basename($cat_image) != $term_data['image']) {
|
|
| 3961 | 3961 | $attachment = true; |
| 3962 | - update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype ); |
|
| 3962 | + update_tax_meta($term_id, 'ct_cat_default_img', array('id' => 'image', 'src' => $uploads['url'].'/'.$term_data['image']), $cat_posttype);
|
|
| 3963 | 3963 | } |
| 3964 | 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'] ) {
|
|
| 3970 | + if (basename($cat_icon) != $term_data['icon']) {
|
|
| 3971 | 3971 | $attachment = true; |
| 3972 | - update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype ); |
|
| 3972 | + update_tax_meta($term_id, 'ct_cat_icon', array('id' => 'icon', 'src' => $uploads['url'].'/'.$term_data['icon']), $cat_posttype);
|
|
| 3973 | 3973 | } |
| 3974 | 3974 | } |
| 3975 | 3975 | |
| 3976 | - if ( $attachment ) {
|
|
| 3976 | + if ($attachment) {
|
|
| 3977 | 3977 | $images++; |
| 3978 | 3978 | } |
| 3979 | 3979 | } |
@@ -3995,34 +3995,34 @@ discard block |
||
| 3995 | 3995 | $json['invalid'] = $invalid; |
| 3996 | 3996 | $json['images'] = $images; |
| 3997 | 3997 | |
| 3998 | - wp_send_json( $json ); |
|
| 3998 | + wp_send_json($json); |
|
| 3999 | 3999 | exit; |
| 4000 | - } else if ( $task == 'import_post' ) {
|
|
| 4000 | + } else if ($task == 'import_post') {
|
|
| 4001 | 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;' ); |
|
| 4002 | + wp_defer_term_counting(true); |
|
| 4003 | + wp_defer_comment_counting(true); |
|
| 4004 | + $wpdb->query('SET autocommit = 0;');
|
|
| 4005 | 4005 | |
| 4006 | 4006 | //remove_all_actions('publish_post');
|
| 4007 | 4007 | //remove_all_actions('transition_post_status');
|
| 4008 | 4008 | //remove_all_actions('publish_future_post');
|
| 4009 | 4009 | |
| 4010 | 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;
|
|
| 4011 | + $is_claim_active = is_plugin_active('geodir_claim_listing/geodir_claim_listing.php') && get_option('geodir_claim_enable') === 'yes' ? true : false;
|
|
| 4012 | 4012 | $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. |
| 4013 | 4013 | $default_status = 'publish'; |
| 4014 | - $current_date = date_i18n( 'Y-m-d', time() ); |
|
| 4014 | + $current_date = date_i18n('Y-m-d', time());
|
|
| 4015 | 4015 | |
| 4016 | 4016 | $columns = isset($file[0]) ? $file[0] : NULL; |
| 4017 | 4017 | |
| 4018 | 4018 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 4019 | 4019 | $json['error'] = CSV_INVAILD_FILE; |
| 4020 | - wp_send_json( $json ); |
|
| 4020 | + wp_send_json($json); |
|
| 4021 | 4021 | exit; |
| 4022 | 4022 | } |
| 4023 | 4023 | |
| 4024 | 4024 | $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory');
|
| 4025 | - $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' ); |
|
| 4025 | + $wp_chars_error = __('(check & remove if any invalid characters used in data)', 'geodirectory');
|
|
| 4026 | 4026 | $processed_actual = 0; |
| 4027 | 4027 | for ($i = 1; $i <= $limit; $i++) {
|
| 4028 | 4028 | $index = $processed + $i; |
@@ -4031,9 +4031,9 @@ discard block |
||
| 4031 | 4031 | if (isset($file[$index])) {
|
| 4032 | 4032 | $processed_actual++; |
| 4033 | 4033 | $row = $file[$index]; |
| 4034 | - $row = array_map( 'trim', $row ); |
|
| 4034 | + $row = array_map('trim', $row);
|
|
| 4035 | 4035 | //$row = array_map( 'utf8_encode', $row ); |
| 4036 | - $row = array_map( 'addslashes_gpc', $row ); |
|
| 4036 | + $row = array_map('addslashes_gpc', $row);
|
|
| 4037 | 4037 | |
| 4038 | 4038 | $post_id = ''; |
| 4039 | 4039 | $post_title = ''; |
@@ -4070,78 +4070,78 @@ discard block |
||
| 4070 | 4070 | $original_post_id = ''; |
| 4071 | 4071 | |
| 4072 | 4072 | $c = 0; |
| 4073 | - foreach ($columns as $column ) {
|
|
| 4073 | + foreach ($columns as $column) {
|
|
| 4074 | 4074 | $gd_post[$column] = $row[$c]; |
| 4075 | 4075 | |
| 4076 | - if ( $column == 'post_id' ) {
|
|
| 4076 | + if ($column == 'post_id') {
|
|
| 4077 | 4077 | $post_id = $row[$c]; |
| 4078 | - } else if ( $column == 'post_title' ) {
|
|
| 4078 | + } else if ($column == 'post_title') {
|
|
| 4079 | 4079 | $post_title = sanitize_text_field($row[$c]); |
| 4080 | - } else if ( $column == 'post_author' ) {
|
|
| 4080 | + } else if ($column == 'post_author') {
|
|
| 4081 | 4081 | $post_author = $row[$c]; |
| 4082 | - } else if ( $column == 'post_content' ) {
|
|
| 4082 | + } else if ($column == 'post_content') {
|
|
| 4083 | 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' ) {
|
|
| 4084 | + } else if ($column == 'post_category' && $row[$c] != '') {
|
|
| 4085 | + $post_category_arr = explode(',', $row[$c]);
|
|
| 4086 | + } else if ($column == 'default_category') {
|
|
| 4087 | 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' ) {
|
|
| 4088 | + } else if ($column == 'post_tags' && $row[$c] != '') {
|
|
| 4089 | + $post_tags = explode(',', sanitize_text_field($row[$c]));
|
|
| 4090 | + } else if ($column == 'post_type') {
|
|
| 4091 | 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' ) {
|
|
| 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 | 4097 | $geodir_video = $row[$c]; |
| 4098 | - } else if ( $column == 'post_address' ) {
|
|
| 4098 | + } else if ($column == 'post_address') {
|
|
| 4099 | 4099 | $post_address = sanitize_text_field($row[$c]); |
| 4100 | - } else if ( $column == 'post_city' ) {
|
|
| 4100 | + } else if ($column == 'post_city') {
|
|
| 4101 | 4101 | $post_city = sanitize_text_field($row[$c]); |
| 4102 | - } else if ( $column == 'post_region' ) {
|
|
| 4102 | + } else if ($column == 'post_region') {
|
|
| 4103 | 4103 | $post_region = sanitize_text_field($row[$c]); |
| 4104 | - } else if ( $column == 'post_country' ) {
|
|
| 4104 | + } else if ($column == 'post_country') {
|
|
| 4105 | 4105 | $post_country = sanitize_text_field($row[$c]); |
| 4106 | - } else if ( $column == 'post_zip' ) {
|
|
| 4106 | + } else if ($column == 'post_zip') {
|
|
| 4107 | 4107 | $post_zip = sanitize_text_field($row[$c]); |
| 4108 | - } else if ( $column == 'post_latitude' ) {
|
|
| 4108 | + } else if ($column == 'post_latitude') {
|
|
| 4109 | 4109 | $post_latitude = sanitize_text_field($row[$c]); |
| 4110 | - } else if ( $column == 'post_longitude' ) {
|
|
| 4110 | + } else if ($column == 'post_longitude') {
|
|
| 4111 | 4111 | $post_longitude = sanitize_text_field($row[$c]); |
| 4112 | - } else if ( $column == 'post_neighbourhood' ) {
|
|
| 4112 | + } else if ($column == 'post_neighbourhood') {
|
|
| 4113 | 4113 | $post_neighbourhood = sanitize_text_field($row[$c]); |
| 4114 | 4114 | unset($gd_post[$column]); |
| 4115 | - } else if ( $column == 'neighbourhood_latitude' ) {
|
|
| 4115 | + } else if ($column == 'neighbourhood_latitude') {
|
|
| 4116 | 4116 | $neighbourhood_latitude = sanitize_text_field($row[$c]); |
| 4117 | - } else if ( $column == 'neighbourhood_longitude' ) {
|
|
| 4117 | + } else if ($column == 'neighbourhood_longitude') {
|
|
| 4118 | 4118 | $neighbourhood_longitude = sanitize_text_field($row[$c]); |
| 4119 | - } else if ( $column == 'geodir_timing' ) {
|
|
| 4119 | + } else if ($column == 'geodir_timing') {
|
|
| 4120 | 4120 | $geodir_timing = sanitize_text_field($row[$c]); |
| 4121 | - } else if ( $column == 'geodir_contact' ) {
|
|
| 4121 | + } else if ($column == 'geodir_contact') {
|
|
| 4122 | 4122 | $geodir_contact = sanitize_text_field($row[$c]); |
| 4123 | - } else if ( $column == 'geodir_email' ) {
|
|
| 4123 | + } else if ($column == 'geodir_email') {
|
|
| 4124 | 4124 | $geodir_email = sanitize_email($row[$c]); |
| 4125 | - } else if ( $column == 'geodir_website' ) {
|
|
| 4125 | + } else if ($column == 'geodir_website') {
|
|
| 4126 | 4126 | $geodir_website = sanitize_text_field($row[$c]); |
| 4127 | - } else if ( $column == 'geodir_twitter' ) {
|
|
| 4127 | + } else if ($column == 'geodir_twitter') {
|
|
| 4128 | 4128 | $geodir_twitter = sanitize_text_field($row[$c]); |
| 4129 | - } else if ( $column == 'geodir_facebook' ) {
|
|
| 4129 | + } else if ($column == 'geodir_facebook') {
|
|
| 4130 | 4130 | $geodir_facebook = sanitize_text_field($row[$c]); |
| 4131 | - } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
|
|
| 4131 | + } else if ($column == 'IMAGE' && !empty($row[$c]) && $row[$c] != '') {
|
|
| 4132 | 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' ) {
|
|
| 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 | 4136 | $row[$c] = str_replace('/', '-', $row[$c]);
|
| 4137 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) ); |
|
| 4137 | + $expire_date = date_i18n('Y-m-d', strtotime($row[$c]));
|
|
| 4138 | 4138 | } |
| 4139 | 4139 | // WPML |
| 4140 | 4140 | if ($is_wpml) {
|
| 4141 | 4141 | if ($column == 'language') {
|
| 4142 | 4142 | $language = geodir_strtolower(trim($row[$c])); |
| 4143 | 4143 | } else if ($column == 'original_post_id') {
|
| 4144 | - $original_post_id = (int)$row[$c]; |
|
| 4144 | + $original_post_id = (int) $row[$c]; |
|
| 4145 | 4145 | } |
| 4146 | 4146 | } |
| 4147 | 4147 | // WPML |
@@ -4149,7 +4149,7 @@ discard block |
||
| 4149 | 4149 | } |
| 4150 | 4150 | // listing claimed or not |
| 4151 | 4151 | if ($is_claim_active && isset($gd_post['claimed'])) {
|
| 4152 | - $gd_post['claimed'] = (int)$gd_post['claimed'] == 1 ? 1 : 0; |
|
| 4152 | + $gd_post['claimed'] = (int) $gd_post['claimed'] == 1 ? 1 : 0; |
|
| 4153 | 4153 | } |
| 4154 | 4154 | |
| 4155 | 4155 | // WPML |
@@ -4160,43 +4160,43 @@ discard block |
||
| 4160 | 4160 | |
| 4161 | 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 | 4166 | $valid = true; |
| 4167 | 4167 | |
| 4168 | - if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
|
|
| 4168 | + if ($post_title == '' || !in_array($post_type, $post_types)) {
|
|
| 4169 | 4169 | $invalid++; |
| 4170 | 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' ) ); |
|
| 4171 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory'));
|
|
| 4172 | 4172 | } |
| 4173 | 4173 | |
| 4174 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
| 4175 | - if ( $location_allowed ) {
|
|
| 4174 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true;
|
|
| 4175 | + if ($location_allowed) {
|
|
| 4176 | 4176 | $location_result = geodir_get_default_location(); |
| 4177 | - if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
|
|
| 4177 | + if ($post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '') {
|
|
| 4178 | 4178 | $invalid_addr++; |
| 4179 | 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 ) ) ) {
|
|
| 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 | 4183 | $invalid_addr++; |
| 4184 | 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' ) ); |
|
| 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 | 4186 | } else {
|
| 4187 | 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. |
|
| 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 | 4189 | } |
| 4190 | 4190 | } |
| 4191 | 4191 | } |
| 4192 | 4192 | } |
| 4193 | 4193 | |
| 4194 | - if ( !$valid ) {
|
|
| 4194 | + if (!$valid) {
|
|
| 4195 | 4195 | continue; |
| 4196 | 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 | 4201 | if ($default_category != '' && !in_array($default_category, $post_category_arr)) {
|
| 4202 | 4202 | $post_category_arr = array_merge(array($default_category), $post_category_arr); |
@@ -4204,29 +4204,29 @@ discard block |
||
| 4204 | 4204 | |
| 4205 | 4205 | $post_category = array(); |
| 4206 | 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 ) ); |
|
| 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 != '' ) {
|
|
| 4211 | + if ($category_name != '') {
|
|
| 4212 | 4212 | $term_category = array(); |
| 4213 | 4213 | |
| 4214 | - if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
|
|
| 4214 | + if ($term = get_term_by('name', $category_name, $cat_taxonomy)) {
|
|
| 4215 | 4215 | $term_category = $term; |
| 4216 | - } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
|
|
| 4216 | + } else if ($term = get_term_by('slug', $category_name, $cat_taxonomy)) {
|
|
| 4217 | 4217 | $term_category = $term; |
| 4218 | 4218 | } else {
|
| 4219 | 4219 | $term_data = array(); |
| 4220 | 4220 | $term_data['name'] = $category_name; |
| 4221 | 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 ); |
|
| 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 | 4226 | } |
| 4227 | 4227 | } |
| 4228 | 4228 | |
| 4229 | - if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
|
|
| 4229 | + if (!empty($term_category) && !is_wp_error($term_category)) {
|
|
| 4230 | 4230 | $post_category[] = intval($term_category->term_id); |
| 4231 | 4231 | |
| 4232 | 4232 | if ($category_name == $default_category) {
|
@@ -4247,15 +4247,15 @@ discard block |
||
| 4247 | 4247 | $save_post['post_tags'] = $post_tags; |
| 4248 | 4248 | |
| 4249 | 4249 | $saved_post_id = NULL; |
| 4250 | - if ( $import_choice == 'update' ) {
|
|
| 4251 | - $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' ); |
|
| 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 ) ) {
|
|
| 4253 | + if ($post_id > 0 && get_post($post_id)) {
|
|
| 4254 | 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; |
|
| 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 | 4259 | $saved_post_id = 0; |
| 4260 | 4260 | } else {
|
| 4261 | 4261 | $saved_post_id = $post_id; |
@@ -4263,9 +4263,9 @@ discard block |
||
| 4263 | 4263 | } |
| 4264 | 4264 | } |
| 4265 | 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; |
|
| 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 | 4269 | $saved_post_id = 0; |
| 4270 | 4270 | } else {
|
| 4271 | 4271 | $created++; |
@@ -4273,19 +4273,19 @@ discard block |
||
| 4273 | 4273 | } |
| 4274 | 4274 | } |
| 4275 | 4275 | |
| 4276 | - if ( !$saved_post_id > 0 ) {
|
|
| 4276 | + if (!$saved_post_id > 0) {
|
|
| 4277 | 4277 | $invalid++; |
| 4278 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error ); |
|
| 4278 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_wp_error); |
|
| 4279 | 4279 | } |
| 4280 | - } else if ( $import_choice == 'skip' ) {
|
|
| 4281 | - if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 4280 | + } else if ($import_choice == 'skip') {
|
|
| 4281 | + if ($post_id > 0 && get_post($post_id)) {
|
|
| 4282 | 4282 | $skipped++; |
| 4283 | 4283 | } else {
|
| 4284 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
|
|
| 4285 | - if ( is_wp_error( $saved_post_id ) ) {
|
|
| 4284 | + if ($saved_post_id = wp_insert_post($save_post, true)) {
|
|
| 4285 | + if (is_wp_error($saved_post_id)) {
|
|
| 4286 | 4286 | $invalid++; |
| 4287 | 4287 | |
| 4288 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error ); |
|
| 4288 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$saved_post_id->get_error_message().' '.$wp_chars_error); |
|
| 4289 | 4289 | $saved_post_id = 0; |
| 4290 | 4290 | } else {
|
| 4291 | 4291 | $created++; |
@@ -4293,28 +4293,28 @@ discard block |
||
| 4293 | 4293 | } else {
|
| 4294 | 4294 | $invalid++; |
| 4295 | 4295 | |
| 4296 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
| 4296 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error); |
|
| 4297 | 4297 | } |
| 4298 | 4298 | } |
| 4299 | 4299 | } else {
|
| 4300 | 4300 | $invalid++; |
| 4301 | 4301 | |
| 4302 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
| 4302 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error); |
|
| 4303 | 4303 | } |
| 4304 | 4304 | |
| 4305 | - if ( (int)$saved_post_id > 0 ) {
|
|
| 4305 | + if ((int) $saved_post_id > 0) {
|
|
| 4306 | 4306 | // WPML |
| 4307 | 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 ); |
|
| 4308 | + $wpml_post_type = 'post_'.$post_type; |
|
| 4309 | + $source_language = geodir_get_language_for_element($original_post_id, $wpml_post_type); |
|
| 4310 | 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 ); |
|
| 4314 | + $sitepress->set_element_language_details($saved_post_id, $wpml_post_type, $trid, $language, $source_language); |
|
| 4315 | 4315 | } |
| 4316 | 4316 | // WPML |
| 4317 | - $gd_post_info = geodir_get_post_info( $saved_post_id ); |
|
| 4317 | + $gd_post_info = geodir_get_post_info($saved_post_id); |
|
| 4318 | 4318 | |
| 4319 | 4319 | $gd_post['post_id'] = $saved_post_id; |
| 4320 | 4320 | $gd_post['ID'] = $saved_post_id; |
@@ -4326,7 +4326,7 @@ discard block |
||
| 4326 | 4326 | |
| 4327 | 4327 | // post location |
| 4328 | 4328 | $post_location_id = 0; |
| 4329 | - if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
|
|
| 4329 | + if ($location_allowed && !empty($location_result) && $location_result->location_id > 0) {
|
|
| 4330 | 4330 | $gd_post['post_neighbourhood'] = ''; |
| 4331 | 4331 | |
| 4332 | 4332 | $post_location_info = array( |
@@ -4336,7 +4336,7 @@ discard block |
||
| 4336 | 4336 | 'geo_lat' => $post_latitude, |
| 4337 | 4337 | 'geo_lng' => $post_longitude |
| 4338 | 4338 | ); |
| 4339 | - if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
|
|
| 4339 | + if ($location_id = (int) geodir_add_new_location($post_location_info)) {
|
|
| 4340 | 4340 | $post_location_id = $location_id; |
| 4341 | 4341 | } |
| 4342 | 4342 | |
@@ -4374,14 +4374,14 @@ discard block |
||
| 4374 | 4374 | $gd_post['post_location_id'] = $post_location_id; |
| 4375 | 4375 | |
| 4376 | 4376 | // post package info |
| 4377 | - $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0; |
|
| 4377 | + $package_id = isset($gd_post['package_id']) && !empty($gd_post['package_id']) ? (int) $gd_post['package_id'] : 0; |
|
| 4378 | 4378 | if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
|
| 4379 | 4379 | $package_id = $gd_post_info->package_id; |
| 4380 | 4380 | } |
| 4381 | 4381 | |
| 4382 | 4382 | $package_info = array(); |
| 4383 | 4383 | if ($package_id && function_exists('geodir_get_package_info_by_id')) {
|
| 4384 | - $package_info = (array)geodir_get_package_info_by_id($package_id); |
|
| 4384 | + $package_info = (array) geodir_get_package_info_by_id($package_id); |
|
| 4385 | 4385 | |
| 4386 | 4386 | if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
|
| 4387 | 4387 | $package_info = array(); |
@@ -4389,18 +4389,18 @@ discard block |
||
| 4389 | 4389 | } |
| 4390 | 4390 | |
| 4391 | 4391 | if (empty($package_info)) {
|
| 4392 | - $package_info = (array)geodir_post_package_info( array(), '', $post_type ); |
|
| 4392 | + $package_info = (array) geodir_post_package_info(array(), '', $post_type); |
|
| 4393 | 4393 | } |
| 4394 | 4394 | |
| 4395 | - if (!empty($package_info)) {
|
|
| 4395 | + if (!empty($package_info)) {
|
|
| 4396 | 4396 | $package_id = $package_info['pid']; |
| 4397 | 4397 | |
| 4398 | 4398 | if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
|
| 4399 | 4399 | $gd_post['expire_date'] = $expire_date; |
| 4400 | 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' ) ); |
|
| 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 | 4404 | } else {
|
| 4405 | 4405 | $gd_post['expire_date'] = 'Never'; |
| 4406 | 4406 | } |
@@ -4409,7 +4409,7 @@ discard block |
||
| 4409 | 4409 | $gd_post['package_id'] = $package_id; |
| 4410 | 4410 | } |
| 4411 | 4411 | |
| 4412 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 4412 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 4413 | 4413 | |
| 4414 | 4414 | if ($post_type == 'gd_event') {
|
| 4415 | 4415 | $gd_post = geodir_imex_process_event_data($gd_post); |
@@ -4420,28 +4420,28 @@ discard block |
||
| 4420 | 4420 | } |
| 4421 | 4421 | |
| 4422 | 4422 | // Export franchise fields |
| 4423 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
| 4423 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false;
|
|
| 4424 | 4424 | if ($is_franchise_active) {
|
| 4425 | - if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
|
|
| 4425 | + if (isset($gd_post['gd_is_franchise']) && (int) $gd_post['gd_is_franchise'] == 1) {
|
|
| 4426 | 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 ); |
|
| 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 | 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 ); |
|
| 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 | 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'] ); |
|
| 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 | 4439 | } |
| 4440 | 4440 | } |
| 4441 | 4441 | } |
| 4442 | 4442 | |
| 4443 | 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'] ) ); |
|
| 4444 | + $save_post['post_category'] = array_unique(array_map('intval', $save_post['post_category']));
|
|
| 4445 | 4445 | if ($default_category_id) {
|
| 4446 | 4446 | $save_post['post_default_category'] = $default_category_id; |
| 4447 | 4447 | $gd_post['default_category'] = $default_category_id; |
@@ -4450,34 +4450,34 @@ discard block |
||
| 4450 | 4450 | } |
| 4451 | 4451 | |
| 4452 | 4452 | // Save post info |
| 4453 | - geodir_save_post_info( $saved_post_id, $gd_post ); |
|
| 4453 | + geodir_save_post_info($saved_post_id, $gd_post); |
|
| 4454 | 4454 | // post taxonomies |
| 4455 | - if ( !empty( $save_post['post_category'] ) ) {
|
|
| 4456 | - wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy ); |
|
| 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'] : ''; |
|
| 4458 | + $post_default_category = isset($save_post['post_default_category']) ? $save_post['post_default_category'] : ''; |
|
| 4459 | 4459 | if ($default_category_id) {
|
| 4460 | 4460 | $post_default_category = $default_category_id; |
| 4461 | 4461 | } |
| 4462 | 4462 | $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy); |
| 4463 | 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:' : '';
|
|
| 4464 | + $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']).',y:' : '';
|
|
| 4465 | 4465 | |
| 4466 | 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); |
|
| 4467 | + $post_category_str = str_replace($post_default_category.',y:', $post_default_category.',y,d:', $post_category_str); |
|
| 4468 | 4468 | } |
| 4469 | 4469 | |
| 4470 | 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 ); |
|
| 4472 | + geodir_set_postcat_structure($saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str); |
|
| 4473 | 4473 | } |
| 4474 | 4474 | |
| 4475 | - if ( !empty( $save_post['post_tags'] ) ) {
|
|
| 4476 | - wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy ); |
|
| 4475 | + if (!empty($save_post['post_tags'])) {
|
|
| 4476 | + wp_set_object_terms($saved_post_id, $save_post['post_tags'], $tags_taxonomy); |
|
| 4477 | 4477 | } |
| 4478 | 4478 | |
| 4479 | 4479 | // Post images |
| 4480 | - if ( !empty( $post_images ) ) {
|
|
| 4480 | + if (!empty($post_images)) {
|
|
| 4481 | 4481 | $post_images = array_unique($post_images); |
| 4482 | 4482 | |
| 4483 | 4483 | $old_post_images_arr = array(); |
@@ -4485,61 +4485,61 @@ discard block |
||
| 4485 | 4485 | |
| 4486 | 4486 | $order = 1; |
| 4487 | 4487 | |
| 4488 | - $old_post_images = geodir_get_images( $saved_post_id ); |
|
| 4488 | + $old_post_images = geodir_get_images($saved_post_id); |
|
| 4489 | 4489 | if (!empty($old_post_images)) {
|
| 4490 | - foreach( $old_post_images as $old_post_image ) {
|
|
| 4490 | + foreach ($old_post_images as $old_post_image) {
|
|
| 4491 | 4491 | if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
|
| 4492 | 4492 | $old_post_images_arr[] = $old_post_image->file; |
| 4493 | 4493 | } |
| 4494 | 4494 | } |
| 4495 | 4495 | } |
| 4496 | 4496 | |
| 4497 | - foreach ( $post_images as $post_image ) {
|
|
| 4498 | - $image_name = basename( $post_image ); |
|
| 4497 | + foreach ($post_images as $post_image) {
|
|
| 4498 | + $image_name = basename($post_image); |
|
| 4499 | 4499 | $saved_post_images_arr[] = $image_name; |
| 4500 | 4500 | |
| 4501 | - if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
|
|
| 4501 | + if (!empty($old_post_images_arr) && in_array($image_name, $old_post_images_arr)) {
|
|
| 4502 | 4502 | continue; // Skip if image already exists. |
| 4503 | 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 ) ) {
|
|
| 4511 | + if (!empty($arr_file_type)) {
|
|
| 4512 | 4512 | $uploaded_file_type = $arr_file_type['type']; |
| 4513 | 4513 | |
| 4514 | 4514 | $attachment = array(); |
| 4515 | 4515 | $attachment['post_id'] = $saved_post_id; |
| 4516 | 4516 | $attachment['title'] = $proper_image_name; |
| 4517 | 4517 | $attachment['content'] = ''; |
| 4518 | - $attachment['file'] = $uploads_subdir . '/' . $image_name; |
|
| 4518 | + $attachment['file'] = $uploads_subdir.'/'.$image_name; |
|
| 4519 | 4519 | $attachment['mime_type'] = $uploaded_file_type; |
| 4520 | 4520 | $attachment['menu_order'] = $order; |
| 4521 | 4521 | $attachment['is_featured'] = 0; |
| 4522 | 4522 | |
| 4523 | 4523 | $attachment_set = ''; |
| 4524 | - foreach ( $attachment as $key => $val ) {
|
|
| 4525 | - if ( $val != '' ) {
|
|
| 4526 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
| 4524 | + foreach ($attachment as $key => $val) {
|
|
| 4525 | + if ($val != '') {
|
|
| 4526 | + $attachment_set .= $key." = '".$val."', "; |
|
| 4527 | 4527 | } |
| 4528 | 4528 | } |
| 4529 | - $attachment_set = trim( $attachment_set, ", " ); |
|
| 4529 | + $attachment_set = trim($attachment_set, ", "); |
|
| 4530 | 4530 | |
| 4531 | 4531 | // Add new attachment |
| 4532 | - $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set ); |
|
| 4532 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
|
|
| 4533 | 4533 | |
| 4534 | 4534 | $order++; |
| 4535 | 4535 | } |
| 4536 | 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) . "' )" : '';
|
|
| 4538 | + $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/".implode("' AND file NOT LIKE '%/", $saved_post_images_arr)."' )" : '';
|
|
| 4539 | 4539 | // Remove previous attachment |
| 4540 | - $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql ); |
|
| 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 ) ) {
|
|
| 4542 | + if (!empty($saved_post_images_arr)) {
|
|
| 4543 | 4543 | geodir_set_wp_featured_image($saved_post_id); |
| 4544 | 4544 | /* |
| 4545 | 4545 | $menu_order = 1; |
@@ -4556,13 +4556,13 @@ discard block |
||
| 4556 | 4556 | }*/ |
| 4557 | 4557 | } |
| 4558 | 4558 | |
| 4559 | - if ( $order > 1 ) {
|
|
| 4559 | + if ($order > 1) {
|
|
| 4560 | 4560 | $images++; |
| 4561 | 4561 | } |
| 4562 | 4562 | } |
| 4563 | 4563 | |
| 4564 | 4564 | /** This action is documented in geodirectory-functions/post-functions.php */ |
| 4565 | - do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post ); |
|
| 4565 | + do_action('geodir_after_save_listing', $saved_post_id, $gd_post);
|
|
| 4566 | 4566 | |
| 4567 | 4567 | if (isset($is_featured)) {
|
| 4568 | 4568 | geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured); |
@@ -4582,10 +4582,10 @@ discard block |
||
| 4582 | 4582 | } |
| 4583 | 4583 | |
| 4584 | 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;' ); |
|
| 4585 | + wp_defer_term_counting(false); |
|
| 4586 | + wp_defer_comment_counting(false); |
|
| 4587 | + $wpdb->query('COMMIT;');
|
|
| 4588 | + $wpdb->query('SET autocommit = 1;');
|
|
| 4589 | 4589 | |
| 4590 | 4590 | $json = array(); |
| 4591 | 4591 | $json['processed'] = $processed_actual; |
@@ -4596,9 +4596,9 @@ discard block |
||
| 4596 | 4596 | $json['invalid_addr'] = $invalid_addr; |
| 4597 | 4597 | $json['images'] = $images; |
| 4598 | 4598 | |
| 4599 | - wp_send_json( $json ); |
|
| 4599 | + wp_send_json($json); |
|
| 4600 | 4600 | exit; |
| 4601 | - } else if ( $task == 'import_loc' ) {
|
|
| 4601 | + } else if ($task == 'import_loc') {
|
|
| 4602 | 4602 | global $gd_post_types; |
| 4603 | 4603 | $gd_post_types = $post_types; |
| 4604 | 4604 | |
@@ -4607,82 +4607,82 @@ discard block |
||
| 4607 | 4607 | |
| 4608 | 4608 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 4609 | 4609 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
| 4610 | - wp_send_json( $json ); |
|
| 4610 | + wp_send_json($json); |
|
| 4611 | 4611 | } |
| 4612 | 4612 | |
| 4613 | 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' ); |
|
| 4614 | + $gd_error_location = __('Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory');
|
|
| 4615 | 4615 | for ($i = 1; $i <= $limit; $i++) {
|
| 4616 | 4616 | $index = $processed + $i; |
| 4617 | 4617 | |
| 4618 | 4618 | if (isset($file[$index])) {
|
| 4619 | 4619 | $row = $file[$index]; |
| 4620 | - $row = array_map( 'trim', $row ); |
|
| 4620 | + $row = array_map('trim', $row);
|
|
| 4621 | 4621 | $data = array(); |
| 4622 | 4622 | |
| 4623 | - foreach ($columns as $c => $column ) {
|
|
| 4623 | + foreach ($columns as $c => $column) {
|
|
| 4624 | 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 | 4625 | $data[$column] = $row[$c]; |
| 4626 | 4626 | } |
| 4627 | 4627 | } |
| 4628 | 4628 | |
| 4629 | - if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
|
|
| 4629 | + if (empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude'])) {
|
|
| 4630 | 4630 | $invalid++; |
| 4631 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4631 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
| 4632 | 4632 | continue; |
| 4633 | 4633 | } |
| 4634 | 4634 | |
| 4635 | 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 ) ) {
|
|
| 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 | 4640 | $updated++; |
| 4641 | 4641 | } else {
|
| 4642 | 4642 | $invalid++; |
| 4643 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4643 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
| 4644 | 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; |
|
| 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; |
|
| 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 | 4654 | } |
| 4655 | 4655 | |
| 4656 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 4656 | + if ($location_id = geodir_location_update_city($data, true, $location)) {
|
|
| 4657 | 4657 | $updated++; |
| 4658 | 4658 | } else {
|
| 4659 | 4659 | $invalid++; |
| 4660 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4660 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
| 4661 | 4661 | } |
| 4662 | 4662 | } else {
|
| 4663 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 4663 | + if ($location_id = geodir_location_insert_city($data, true)) {
|
|
| 4664 | 4664 | $created++; |
| 4665 | 4665 | } else {
|
| 4666 | 4666 | $invalid++; |
| 4667 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4667 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
| 4668 | 4668 | } |
| 4669 | 4669 | } |
| 4670 | - } elseif ( $import_choice == 'skip' ) {
|
|
| 4671 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 4670 | + } elseif ($import_choice == 'skip') {
|
|
| 4671 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) {
|
|
| 4672 | 4672 | $skipped++; |
| 4673 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 4673 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) {
|
|
| 4674 | 4674 | $skipped++; |
| 4675 | 4675 | } else {
|
| 4676 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 4676 | + if ($location_id = geodir_location_insert_city($data, true)) {
|
|
| 4677 | 4677 | $created++; |
| 4678 | 4678 | } else {
|
| 4679 | 4679 | $invalid++; |
| 4680 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4680 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
| 4681 | 4681 | } |
| 4682 | 4682 | } |
| 4683 | 4683 | } else {
|
| 4684 | 4684 | $invalid++; |
| 4685 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
| 4685 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
| 4686 | 4686 | } |
| 4687 | 4687 | } |
| 4688 | 4688 | } |
@@ -4696,24 +4696,24 @@ discard block |
||
| 4696 | 4696 | $json['invalid'] = $invalid; |
| 4697 | 4697 | $json['images'] = $images; |
| 4698 | 4698 | |
| 4699 | - wp_send_json( $json ); |
|
| 4700 | - } else if ( $task == 'import_hood' ) {
|
|
| 4699 | + wp_send_json($json); |
|
| 4700 | + } else if ($task == 'import_hood') {
|
|
| 4701 | 4701 | if (!empty($file)) {
|
| 4702 | 4702 | $columns = isset($file[0]) ? $file[0] : NULL; |
| 4703 | 4703 | |
| 4704 | 4704 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 4705 | 4705 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
| 4706 | - wp_send_json( $json ); |
|
| 4706 | + wp_send_json($json); |
|
| 4707 | 4707 | } |
| 4708 | 4708 | |
| 4709 | 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' ); |
|
| 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 | 4711 | for ($i = 1; $i <= $limit; $i++) {
|
| 4712 | 4712 | $index = $processed + $i; |
| 4713 | 4713 | |
| 4714 | 4714 | if (isset($file[$index])) {
|
| 4715 | 4715 | $row = $file[$index]; |
| 4716 | - $row = array_map( 'trim', $row ); |
|
| 4716 | + $row = array_map('trim', $row);
|
|
| 4717 | 4717 | $data = array(); |
| 4718 | 4718 | |
| 4719 | 4719 | foreach ($columns as $c => $column) {
|
@@ -4724,20 +4724,20 @@ discard block |
||
| 4724 | 4724 | |
| 4725 | 4725 | if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) {
|
| 4726 | 4726 | $invalid++; |
| 4727 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4727 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4728 | 4728 | continue; |
| 4729 | 4729 | } |
| 4730 | 4730 | |
| 4731 | 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']);
|
|
| 4732 | + if (!empty($data['location_id']) && (int) $data['location_id'] > 0) {
|
|
| 4733 | + $location_info = geodir_get_location_by_id('', (int) $data['location_id']);
|
|
| 4734 | 4734 | } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) {
|
| 4735 | 4735 | $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region']));
|
| 4736 | 4736 | } |
| 4737 | 4737 | |
| 4738 | 4738 | if (empty($location_info)) {
|
| 4739 | 4739 | $invalid++; |
| 4740 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4740 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4741 | 4741 | continue; |
| 4742 | 4742 | } |
| 4743 | 4743 | |
@@ -4752,35 +4752,35 @@ discard block |
||
| 4752 | 4752 | $hood_data['hood_longitude'] = $data['longitude']; |
| 4753 | 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 | 4759 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
| 4760 | 4760 | $updated++; |
| 4761 | 4761 | } else {
|
| 4762 | 4762 | $invalid++; |
| 4763 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4763 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4764 | 4764 | } |
| 4765 | 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; |
|
| 4766 | + $hood_data['hood_id'] = (int) $neighbourhood->hood_id; |
|
| 4767 | 4767 | |
| 4768 | 4768 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
| 4769 | 4769 | $updated++; |
| 4770 | 4770 | } else {
|
| 4771 | 4771 | $invalid++; |
| 4772 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4772 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4773 | 4773 | } |
| 4774 | 4774 | } else {
|
| 4775 | 4775 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
|
| 4776 | 4776 | $created++; |
| 4777 | 4777 | } else {
|
| 4778 | 4778 | $invalid++; |
| 4779 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4779 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4780 | 4780 | } |
| 4781 | 4781 | } |
| 4782 | - } elseif ( $import_choice == 'skip' ) {
|
|
| 4783 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
|
|
| 4782 | + } elseif ($import_choice == 'skip') {
|
|
| 4783 | + if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) {
|
|
| 4784 | 4784 | $skipped++; |
| 4785 | 4785 | } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
|
| 4786 | 4786 | $skipped++; |
@@ -4790,12 +4790,12 @@ discard block |
||
| 4790 | 4790 | $created++; |
| 4791 | 4791 | } else {
|
| 4792 | 4792 | $invalid++; |
| 4793 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4793 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4794 | 4794 | } |
| 4795 | 4795 | } |
| 4796 | 4796 | } else {
|
| 4797 | 4797 | $invalid++; |
| 4798 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
| 4798 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
| 4799 | 4799 | } |
| 4800 | 4800 | } |
| 4801 | 4801 | } |
@@ -4809,7 +4809,7 @@ discard block |
||
| 4809 | 4809 | $json['invalid'] = $invalid; |
| 4810 | 4810 | $json['images'] = $images; |
| 4811 | 4811 | |
| 4812 | - wp_send_json( $json ); |
|
| 4812 | + wp_send_json($json); |
|
| 4813 | 4813 | } |
| 4814 | 4814 | } |
| 4815 | 4815 | break; |
@@ -4853,29 +4853,29 @@ discard block |
||
| 4853 | 4853 | * } |
| 4854 | 4854 | * @return int|bool Term id when success, false when fail. |
| 4855 | 4855 | */ |
| 4856 | -function geodir_imex_insert_term( $taxonomy, $term_data ) {
|
|
| 4857 | - if ( empty( $taxonomy ) || empty( $term_data ) ) {
|
|
| 4856 | +function geodir_imex_insert_term($taxonomy, $term_data) {
|
|
| 4857 | + if (empty($taxonomy) || empty($term_data)) {
|
|
| 4858 | 4858 | return false; |
| 4859 | 4859 | } |
| 4860 | 4860 | |
| 4861 | - $term = isset( $term_data['name'] ) && !empty( $term_data['name'] ) ? $term_data['name'] : ''; |
|
| 4861 | + $term = isset($term_data['name']) && !empty($term_data['name']) ? $term_data['name'] : ''; |
|
| 4862 | 4862 | $args = array(); |
| 4863 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
| 4864 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
| 4865 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
| 4863 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
| 4864 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
| 4865 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
| 4866 | 4866 | |
| 4867 | - if ( ( !empty( $args['slug'] ) && term_exists( $args['slug'], $taxonomy ) ) || empty( $args['slug'] ) ) {
|
|
| 4868 | - $term_args = array_merge( $term_data, $args ); |
|
| 4869 | - $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); |
|
| 4870 | - $term_args = wp_parse_args( $term_args, $defaults ); |
|
| 4871 | - $term_args = sanitize_term( $term_args, $taxonomy, 'db' ); |
|
| 4872 | - $args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args ); |
|
| 4867 | + if ((!empty($args['slug']) && term_exists($args['slug'], $taxonomy)) || empty($args['slug'])) {
|
|
| 4868 | + $term_args = array_merge($term_data, $args); |
|
| 4869 | + $defaults = array('alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
|
|
| 4870 | + $term_args = wp_parse_args($term_args, $defaults); |
|
| 4871 | + $term_args = sanitize_term($term_args, $taxonomy, 'db'); |
|
| 4872 | + $args['slug'] = wp_unique_term_slug($args['slug'], (object) $term_args); |
|
| 4873 | 4873 | } |
| 4874 | 4874 | |
| 4875 | - if( !empty( $term ) ) {
|
|
| 4876 | - $result = wp_insert_term( $term, $taxonomy, $args ); |
|
| 4877 | - if( !is_wp_error( $result ) ) {
|
|
| 4878 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4875 | + if (!empty($term)) {
|
|
| 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 | 4879 | } |
| 4880 | 4880 | } |
| 4881 | 4881 | |
@@ -4905,36 +4905,36 @@ discard block |
||
| 4905 | 4905 | * } |
| 4906 | 4906 | * @return int|bool Term id when success, false when fail. |
| 4907 | 4907 | */ |
| 4908 | -function geodir_imex_update_term( $taxonomy, $term_data ) {
|
|
| 4909 | - if ( empty( $taxonomy ) || empty( $term_data ) ) {
|
|
| 4908 | +function geodir_imex_update_term($taxonomy, $term_data) {
|
|
| 4909 | + if (empty($taxonomy) || empty($term_data)) {
|
|
| 4910 | 4910 | return false; |
| 4911 | 4911 | } |
| 4912 | 4912 | |
| 4913 | - $term_id = isset( $term_data['term_id'] ) && !empty( $term_data['term_id'] ) ? $term_data['term_id'] : 0; |
|
| 4913 | + $term_id = isset($term_data['term_id']) && !empty($term_data['term_id']) ? $term_data['term_id'] : 0; |
|
| 4914 | 4914 | |
| 4915 | 4915 | $args = array(); |
| 4916 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
| 4917 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
| 4918 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
| 4916 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
| 4917 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
| 4918 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
| 4919 | 4919 | |
| 4920 | - if ( $term_id > 0 && $term_info = (array)get_term( $term_id, $taxonomy ) ) {
|
|
| 4920 | + if ($term_id > 0 && $term_info = (array) get_term($term_id, $taxonomy)) {
|
|
| 4921 | 4921 | $term_data['term_id'] = $term_info['term_id']; |
| 4922 | 4922 | |
| 4923 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
| 4923 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
| 4924 | 4924 | |
| 4925 | - if( !is_wp_error( $result ) ) {
|
|
| 4926 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4925 | + if (!is_wp_error($result)) {
|
|
| 4926 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
| 4927 | 4927 | } |
| 4928 | - } else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 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 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
| 4931 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
| 4932 | 4932 | |
| 4933 | - if( !is_wp_error( $result ) ) {
|
|
| 4934 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 4933 | + if (!is_wp_error($result)) {
|
|
| 4934 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
| 4935 | 4935 | } |
| 4936 | 4936 | } else {
|
| 4937 | - return geodir_imex_insert_term( $taxonomy, $term_data ); |
|
| 4937 | + return geodir_imex_insert_term($taxonomy, $term_data); |
|
| 4938 | 4938 | } |
| 4939 | 4939 | |
| 4940 | 4940 | return false; |
@@ -4953,20 +4953,20 @@ discard block |
||
| 4953 | 4953 | * @param string $post_type Post type. |
| 4954 | 4954 | * @return int Posts count. |
| 4955 | 4955 | */ |
| 4956 | -function geodir_get_posts_count( $post_type ) {
|
|
| 4956 | +function geodir_get_posts_count($post_type) {
|
|
| 4957 | 4957 | global $wpdb, $plugin_prefix; |
| 4958 | 4958 | |
| 4959 | - if ( !post_type_exists( $post_type ) ) {
|
|
| 4959 | + if (!post_type_exists($post_type)) {
|
|
| 4960 | 4960 | return 0; |
| 4961 | 4961 | } |
| 4962 | 4962 | |
| 4963 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 4963 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 4964 | 4964 | |
| 4965 | 4965 | // Skip listing with statuses trash, auto-draft etc... |
| 4966 | 4966 | $skip_statuses = geodir_imex_export_skip_statuses(); |
| 4967 | 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 ) . "')";
|
|
| 4968 | + if (!empty($skip_statuses) && is_array($skip_statuses)) {
|
|
| 4969 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')";
|
|
| 4970 | 4970 | } |
| 4971 | 4971 | |
| 4972 | 4972 | /** |
@@ -4977,11 +4977,11 @@ discard block |
||
| 4977 | 4977 | * |
| 4978 | 4978 | * @param string $where SQL where clause part. |
| 4979 | 4979 | */ |
| 4980 | - $where_statuses = apply_filters( 'geodir_get_posts_count', $where_statuses, $post_type ); |
|
| 4980 | + $where_statuses = apply_filters('geodir_get_posts_count', $where_statuses, $post_type);
|
|
| 4981 | 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 );
|
|
| 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 | 4983 | |
| 4984 | - $posts_count = (int)$wpdb->get_var( $query ); |
|
| 4984 | + $posts_count = (int) $wpdb->get_var($query); |
|
| 4985 | 4985 | |
| 4986 | 4986 | /** |
| 4987 | 4987 | * Modify returned post counts for the current post type. |
@@ -4992,7 +4992,7 @@ discard block |
||
| 4992 | 4992 | * @param int $posts_count Post counts. |
| 4993 | 4993 | * @param string $post_type Post type. |
| 4994 | 4994 | */ |
| 4995 | - $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type ); |
|
| 4995 | + $posts_count = apply_filters('geodir_imex_count_posts', $posts_count, $post_type);
|
|
| 4996 | 4996 | |
| 4997 | 4997 | return $posts_count; |
| 4998 | 4998 | } |
@@ -5013,19 +5013,19 @@ discard block |
||
| 5013 | 5013 | * @param int $page_no Page number. Default 0. |
| 5014 | 5014 | * @return array Array of posts data. |
| 5015 | 5015 | */ |
| 5016 | -function geodir_imex_get_posts( $post_type, $per_page = 0, $page_no = 0 ) {
|
|
| 5016 | +function geodir_imex_get_posts($post_type, $per_page = 0, $page_no = 0) {
|
|
| 5017 | 5017 | global $wp_filesystem; |
| 5018 | 5018 | |
| 5019 | - $posts = geodir_get_export_posts( $post_type, $per_page, $page_no ); |
|
| 5019 | + $posts = geodir_get_export_posts($post_type, $per_page, $page_no); |
|
| 5020 | 5020 | |
| 5021 | 5021 | $csv_rows = array(); |
| 5022 | 5022 | |
| 5023 | - if ( !empty( $posts ) ) {
|
|
| 5024 | - $is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' ); |
|
| 5023 | + if (!empty($posts)) {
|
|
| 5024 | + $is_payment_plugin = is_plugin_active('geodir_payment_manager/geodir_payment_manager.php');
|
|
| 5025 | 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; |
|
| 5026 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true;
|
|
| 5027 | 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;
|
|
| 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'; |
@@ -5036,7 +5036,7 @@ discard block |
||
| 5036 | 5036 | $csv_row[] = 'default_category'; |
| 5037 | 5037 | $csv_row[] = 'post_tags'; |
| 5038 | 5038 | $csv_row[] = 'post_type'; |
| 5039 | - if ( $post_type == 'gd_event' ) {
|
|
| 5039 | + if ($post_type == 'gd_event') {
|
|
| 5040 | 5040 | $csv_row[] = 'event_date'; |
| 5041 | 5041 | $csv_row[] = 'event_enddate'; |
| 5042 | 5042 | $csv_row[] = 'starttime'; |
@@ -5094,15 +5094,15 @@ discard block |
||
| 5094 | 5094 | } |
| 5095 | 5095 | // WPML |
| 5096 | 5096 | |
| 5097 | - $custom_fields = geodir_imex_get_custom_fields( $post_type ); |
|
| 5098 | - if ( !empty( $custom_fields ) ) {
|
|
| 5099 | - foreach ( $custom_fields as $custom_field ) {
|
|
| 5097 | + $custom_fields = geodir_imex_get_custom_fields($post_type); |
|
| 5098 | + if (!empty($custom_fields)) {
|
|
| 5099 | + foreach ($custom_fields as $custom_field) {
|
|
| 5100 | 5100 | $csv_row[] = $custom_field->htmlvar_name; |
| 5101 | 5101 | } |
| 5102 | 5102 | } |
| 5103 | 5103 | |
| 5104 | 5104 | // Export franchise fields |
| 5105 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
| 5105 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false;
|
|
| 5106 | 5106 | if ($is_franchise_active) {
|
| 5107 | 5107 | $csv_row[] = 'gd_is_franchise'; |
| 5108 | 5108 | $csv_row[] = 'gd_franchise_lock'; |
@@ -5123,28 +5123,28 @@ discard block |
||
| 5123 | 5123 | $csv_rows[] = $csv_row; |
| 5124 | 5124 | |
| 5125 | 5125 | $images_count = 5; |
| 5126 | - $xx=0; |
|
| 5127 | - foreach ( $posts as $post ) {$xx++;
|
|
| 5126 | + $xx = 0; |
|
| 5127 | + foreach ($posts as $post) {$xx++;
|
|
| 5128 | 5128 | $post_id = $post['ID']; |
| 5129 | 5129 | |
| 5130 | - $gd_post_info = geodir_get_post_info( $post_id ); |
|
| 5131 | - $post_info = (array)$gd_post_info; |
|
| 5130 | + $gd_post_info = geodir_get_post_info($post_id); |
|
| 5131 | + $post_info = (array) $gd_post_info; |
|
| 5132 | 5132 | |
| 5133 | - $taxonomy_category = $post_type . 'category'; |
|
| 5134 | - $taxonomy_tags = $post_type . '_tags'; |
|
| 5133 | + $taxonomy_category = $post_type.'category'; |
|
| 5134 | + $taxonomy_tags = $post_type.'_tags'; |
|
| 5135 | 5135 | |
| 5136 | 5136 | $post_category = ''; |
| 5137 | 5137 | $default_category_id = $gd_post_info->default_category; |
| 5138 | 5138 | $default_category = ''; |
| 5139 | 5139 | $post_tags = ''; |
| 5140 | - $terms = wp_get_post_terms( $post_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
| 5140 | + $terms = wp_get_post_terms($post_id, array($taxonomy_category, $taxonomy_tags)); |
|
| 5141 | 5141 | |
| 5142 | - if ( !empty( $terms ) && !is_wp_error( $terms ) ) {
|
|
| 5142 | + if (!empty($terms) && !is_wp_error($terms)) {
|
|
| 5143 | 5143 | $post_category = array(); |
| 5144 | 5144 | $post_tags = array(); |
| 5145 | 5145 | |
| 5146 | - foreach ( $terms as $term ) {
|
|
| 5147 | - if ( $term->taxonomy == $taxonomy_category ) {
|
|
| 5146 | + foreach ($terms as $term) {
|
|
| 5147 | + if ($term->taxonomy == $taxonomy_category) {
|
|
| 5148 | 5148 | $post_category[] = $term->name; |
| 5149 | 5149 | |
| 5150 | 5150 | if ($default_category_id == $term->term_id) {
|
@@ -5152,7 +5152,7 @@ discard block |
||
| 5152 | 5152 | } |
| 5153 | 5153 | } |
| 5154 | 5154 | |
| 5155 | - if ( $term->taxonomy == $taxonomy_tags ) {
|
|
| 5155 | + if ($term->taxonomy == $taxonomy_tags) {
|
|
| 5156 | 5156 | $post_tags[] = $term->name; |
| 5157 | 5157 | } |
| 5158 | 5158 | } |
@@ -5160,47 +5160,47 @@ discard block |
||
| 5160 | 5160 | if (empty($default_category) && !empty($post_category)) {
|
| 5161 | 5161 | $default_category = $post_category[0]; // Set first one as default category. |
| 5162 | 5162 | } |
| 5163 | - $post_category = !empty( $post_category ) ? implode( ',', $post_category ) : ''; |
|
| 5164 | - $post_tags = !empty( $post_tags ) ? implode( ',', $post_tags ) : ''; |
|
| 5163 | + $post_category = !empty($post_category) ? implode(',', $post_category) : '';
|
|
| 5164 | + $post_tags = !empty($post_tags) ? implode(',', $post_tags) : '';
|
|
| 5165 | 5165 | } |
| 5166 | 5166 | |
| 5167 | 5167 | // Franchise data |
| 5168 | - if ($is_franchise_active && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 && geodir_franchise_check((int)$post_info['franchise'])) {
|
|
| 5168 | + if ($is_franchise_active && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 && geodir_franchise_check((int) $post_info['franchise'])) {
|
|
| 5169 | 5169 | $franchise_id = $post_info['franchise']; |
| 5170 | 5170 | $gd_franchise_info = geodir_get_post_info($franchise_id); |
| 5171 | 5171 | |
| 5172 | 5172 | if (geodir_franchise_pkg_is_active($gd_franchise_info)) {
|
| 5173 | - $franchise_info = (array)$gd_franchise_info; |
|
| 5173 | + $franchise_info = (array) $gd_franchise_info; |
|
| 5174 | 5174 | $locked_fields = geodir_franchise_get_locked_fields($franchise_id, true); |
| 5175 | 5175 | |
| 5176 | 5176 | if (!empty($locked_fields)) {
|
| 5177 | - foreach( $locked_fields as $locked_field) {
|
|
| 5177 | + foreach ($locked_fields as $locked_field) {
|
|
| 5178 | 5178 | if (isset($post_info[$locked_field]) && isset($franchise_info[$locked_field])) {
|
| 5179 | 5179 | $post_info[$locked_field] = $franchise_info[$locked_field]; |
| 5180 | 5180 | } |
| 5181 | 5181 | |
| 5182 | 5182 | if (in_array($taxonomy_category, $locked_fields) || in_array('post_tags', $locked_fields)) {
|
| 5183 | - $franchise_terms = wp_get_post_terms( $franchise_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
| 5183 | + $franchise_terms = wp_get_post_terms($franchise_id, array($taxonomy_category, $taxonomy_tags)); |
|
| 5184 | 5184 | |
| 5185 | - if ( !empty( $franchise_terms ) && !is_wp_error( $franchise_terms ) ) {
|
|
| 5185 | + if (!empty($franchise_terms) && !is_wp_error($franchise_terms)) {
|
|
| 5186 | 5186 | $franchise_post_category = array(); |
| 5187 | 5187 | $franchise_post_tags = array(); |
| 5188 | 5188 | |
| 5189 | - foreach ( $franchise_terms as $franchise_term ) {
|
|
| 5190 | - if ( $franchise_term->taxonomy == $taxonomy_category ) {
|
|
| 5189 | + foreach ($franchise_terms as $franchise_term) {
|
|
| 5190 | + if ($franchise_term->taxonomy == $taxonomy_category) {
|
|
| 5191 | 5191 | $franchise_post_category[] = $franchise_term->name; |
| 5192 | 5192 | } |
| 5193 | 5193 | |
| 5194 | - if ( $franchise_term->taxonomy == $taxonomy_tags ) {
|
|
| 5194 | + if ($franchise_term->taxonomy == $taxonomy_tags) {
|
|
| 5195 | 5195 | $franchise_post_tags[] = $franchise_term->name; |
| 5196 | 5196 | } |
| 5197 | 5197 | } |
| 5198 | 5198 | |
| 5199 | 5199 | if (in_array($taxonomy_category, $locked_fields)) {
|
| 5200 | - $post_category = !empty( $franchise_post_category ) ? implode( ',', $franchise_post_category ) : ''; |
|
| 5200 | + $post_category = !empty($franchise_post_category) ? implode(',', $franchise_post_category) : '';
|
|
| 5201 | 5201 | } |
| 5202 | 5202 | if (in_array('post_tags', $locked_fields)) {
|
| 5203 | - $post_tags = !empty( $franchise_post_tags ) ? implode( ',', $franchise_post_tags ) : ''; |
|
| 5203 | + $post_tags = !empty($franchise_post_tags) ? implode(',', $franchise_post_tags) : '';
|
|
| 5204 | 5204 | } |
| 5205 | 5205 | } |
| 5206 | 5206 | } |
@@ -5209,18 +5209,18 @@ discard block |
||
| 5209 | 5209 | } |
| 5210 | 5210 | } |
| 5211 | 5211 | |
| 5212 | - $post_images = geodir_get_images( $post_id ); |
|
| 5212 | + $post_images = geodir_get_images($post_id); |
|
| 5213 | 5213 | $current_images = array(); |
| 5214 | - if ( !empty( $post_images ) ) {
|
|
| 5215 | - foreach ( $post_images as $post_image ) {
|
|
| 5216 | - $post_image = (array)$post_image; |
|
| 5217 | - $image = !empty( $post_image ) && isset( $post_image['path'] ) && $wp_filesystem->is_file( $post_image['path'] ) && $wp_filesystem->exists( $post_image['path'] ) ? $post_image['src'] : ''; |
|
| 5218 | - if ( $image ) {
|
|
| 5214 | + if (!empty($post_images)) {
|
|
| 5215 | + foreach ($post_images as $post_image) {
|
|
| 5216 | + $post_image = (array) $post_image; |
|
| 5217 | + $image = !empty($post_image) && isset($post_image['path']) && $wp_filesystem->is_file($post_image['path']) && $wp_filesystem->exists($post_image['path']) ? $post_image['src'] : ''; |
|
| 5218 | + if ($image) {
|
|
| 5219 | 5219 | $current_images[] = $image; |
| 5220 | 5220 | } |
| 5221 | 5221 | } |
| 5222 | 5222 | |
| 5223 | - $images_count = max( $images_count, count( $current_images ) ); |
|
| 5223 | + $images_count = max($images_count, count($current_images)); |
|
| 5224 | 5224 | } |
| 5225 | 5225 | |
| 5226 | 5226 | $csv_row = array(); |
@@ -5232,7 +5232,7 @@ discard block |
||
| 5232 | 5232 | $csv_row[] = $default_category; // default_category |
| 5233 | 5233 | $csv_row[] = $post_tags; // post_tags |
| 5234 | 5234 | $csv_row[] = $post_type; // post_type |
| 5235 | - if ( $post_type == 'gd_event' ) {
|
|
| 5235 | + if ($post_type == 'gd_event') {
|
|
| 5236 | 5236 | $event_data = geodir_imex_get_event_data($post, $gd_post_info); |
| 5237 | 5237 | $csv_row[] = $event_data['event_date']; // event_date |
| 5238 | 5238 | $csv_row[] = $event_data['event_enddate']; // enddate |
@@ -5253,12 +5253,12 @@ discard block |
||
| 5253 | 5253 | $csv_row[] = $event_data['recurring_end_date']; // repeat_end |
| 5254 | 5254 | } |
| 5255 | 5255 | $csv_row[] = $post_info['post_status']; // post_status |
| 5256 | - $csv_row[] = (int)$post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
| 5256 | + $csv_row[] = (int) $post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
| 5257 | 5257 | if ($is_claim_active) {
|
| 5258 | - $csv_row[] = !empty($post_info['claimed']) && (int)$post_info['claimed'] == 1 ? 1 : ''; // claimed |
|
| 5258 | + $csv_row[] = !empty($post_info['claimed']) && (int) $post_info['claimed'] == 1 ? 1 : ''; // claimed |
|
| 5259 | 5259 | } |
| 5260 | 5260 | if ($is_payment_plugin) {
|
| 5261 | - $csv_row[] = (int)$post_info['package_id']; // package_id |
|
| 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 | 5264 | $csv_row[] = $post_info['post_date']; // post_date |
@@ -5294,14 +5294,14 @@ discard block |
||
| 5294 | 5294 | $csv_row[] = $post_info['geodir_special_offers']; // geodir_special_offers |
| 5295 | 5295 | // WPML |
| 5296 | 5296 | if ($is_wpml) {
|
| 5297 | - $csv_row[] = geodir_get_language_for_element( $post_id, 'post_' . $post_type ); |
|
| 5298 | - $csv_row[] = geodir_imex_original_post_id( $post_id, 'post_' . $post_type ); |
|
| 5297 | + $csv_row[] = geodir_get_language_for_element($post_id, 'post_'.$post_type); |
|
| 5298 | + $csv_row[] = geodir_imex_original_post_id($post_id, 'post_'.$post_type); |
|
| 5299 | 5299 | } |
| 5300 | 5300 | // WPML |
| 5301 | 5301 | |
| 5302 | - if ( !empty( $custom_fields ) ) {
|
|
| 5303 | - foreach ( $custom_fields as $custom_field ) {
|
|
| 5304 | - $csv_row[] = isset( $post_info[$custom_field->htmlvar_name] ) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
| 5302 | + if (!empty($custom_fields)) {
|
|
| 5303 | + foreach ($custom_fields as $custom_field) {
|
|
| 5304 | + $csv_row[] = isset($post_info[$custom_field->htmlvar_name]) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
| 5305 | 5305 | } |
| 5306 | 5306 | } |
| 5307 | 5307 | |
@@ -5312,15 +5312,15 @@ discard block |
||
| 5312 | 5312 | $franchise = ''; |
| 5313 | 5313 | |
| 5314 | 5314 | if (geodir_franchise_pkg_is_active($gd_post_info)) {
|
| 5315 | - $gd_is_franchise = (int)get_post_meta( $post_id, 'gd_is_franchise', true ); |
|
| 5316 | - $locaked_fields = $gd_is_franchise ? get_post_meta( $post_id, 'gd_franchise_lock', true ) : ''; |
|
| 5315 | + $gd_is_franchise = (int) get_post_meta($post_id, 'gd_is_franchise', true); |
|
| 5316 | + $locaked_fields = $gd_is_franchise ? get_post_meta($post_id, 'gd_franchise_lock', true) : ''; |
|
| 5317 | 5317 | $locaked_fields = (is_array($locaked_fields) && !empty($locaked_fields) ? implode(",", $locaked_fields) : '');
|
| 5318 | - $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 ? (int)$post_info['franchise'] : 0; // franchise id |
|
| 5318 | + $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 ? (int) $post_info['franchise'] : 0; // franchise id |
|
| 5319 | 5319 | } |
| 5320 | 5320 | |
| 5321 | - $csv_row[] = (int)$gd_is_franchise; // gd_is_franchise |
|
| 5321 | + $csv_row[] = (int) $gd_is_franchise; // gd_is_franchise |
|
| 5322 | 5322 | $csv_row[] = $locaked_fields; // gd_franchise_lock fields |
| 5323 | - $csv_row[] = (int)$franchise; // franchise id |
|
| 5323 | + $csv_row[] = (int) $franchise; // franchise id |
|
| 5324 | 5324 | } |
| 5325 | 5325 | |
| 5326 | 5326 | /** |
@@ -5334,15 +5334,15 @@ discard block |
||
| 5334 | 5334 | */ |
| 5335 | 5335 | $csv_row = apply_filters('geodir_export_listing_csv_column_values', $csv_row, $post_info);
|
| 5336 | 5336 | |
| 5337 | - for ( $c = 0; $c < $images_count; $c++ ) {
|
|
| 5338 | - $csv_row[] = isset( $current_images[$c] ) ? $current_images[$c] : ''; // IMAGE |
|
| 5337 | + for ($c = 0; $c < $images_count; $c++) {
|
|
| 5338 | + $csv_row[] = isset($current_images[$c]) ? $current_images[$c] : ''; // IMAGE |
|
| 5339 | 5339 | } |
| 5340 | 5340 | |
| 5341 | 5341 | $csv_rows[] = $csv_row; |
| 5342 | 5342 | |
| 5343 | 5343 | } |
| 5344 | 5344 | |
| 5345 | - for ( $c = 0; $c < $images_count; $c++ ) {
|
|
| 5345 | + for ($c = 0; $c < $images_count; $c++) {
|
|
| 5346 | 5346 | $csv_rows[0][] = 'IMAGE'; |
| 5347 | 5347 | } |
| 5348 | 5348 | } |
@@ -5364,30 +5364,30 @@ discard block |
||
| 5364 | 5364 | * @param int $page_no Page number. Default 0. |
| 5365 | 5365 | * @return array Array of posts data. |
| 5366 | 5366 | */ |
| 5367 | -function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) {
|
|
| 5367 | +function geodir_get_export_posts($post_type, $per_page = 0, $page_no = 0) {
|
|
| 5368 | 5368 | global $wpdb, $plugin_prefix; |
| 5369 | 5369 | |
| 5370 | - if ( ! post_type_exists( $post_type ) ) |
|
| 5370 | + if (!post_type_exists($post_type)) |
|
| 5371 | 5371 | return new stdClass; |
| 5372 | 5372 | |
| 5373 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 5373 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 5374 | 5374 | |
| 5375 | 5375 | $limit = ''; |
| 5376 | - if ( $per_page > 0 && $page_no > 0 ) {
|
|
| 5377 | - $offset = ( $page_no - 1 ) * $per_page; |
|
| 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; |
|
| 5379 | + if ($offset > 0) {
|
|
| 5380 | + $limit = " LIMIT ".$offset.",".$per_page; |
|
| 5381 | 5381 | } else {
|
| 5382 | - $limit = " LIMIT " . $per_page; |
|
| 5382 | + $limit = " LIMIT ".$per_page; |
|
| 5383 | 5383 | } |
| 5384 | 5384 | } |
| 5385 | 5385 | |
| 5386 | 5386 | // Skip listing with statuses trash, auto-draft etc... |
| 5387 | 5387 | $skip_statuses = geodir_imex_export_skip_statuses(); |
| 5388 | 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 ) . "')";
|
|
| 5389 | + if (!empty($skip_statuses) && is_array($skip_statuses)) {
|
|
| 5390 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')";
|
|
| 5391 | 5391 | } |
| 5392 | 5392 | |
| 5393 | 5393 | /** |
@@ -5398,9 +5398,9 @@ discard block |
||
| 5398 | 5398 | * |
| 5399 | 5399 | * @param string $where SQL where clause part. |
| 5400 | 5400 | */ |
| 5401 | - $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
| 5401 | + $where_statuses = apply_filters('geodir_get_export_posts', $where_statuses, $post_type);
|
|
| 5402 | 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 );
|
|
| 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 | 5404 | /** |
| 5405 | 5405 | * Modify returned posts SQL query for the current post type. |
| 5406 | 5406 | * |
@@ -5410,8 +5410,8 @@ discard block |
||
| 5410 | 5410 | * @param int $query The SQL query. |
| 5411 | 5411 | * @param string $post_type Post type. |
| 5412 | 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 ); |
|
| 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 | 5415 | |
| 5416 | 5416 | /** |
| 5417 | 5417 | * Modify returned post results for the current post type. |
@@ -5422,7 +5422,7 @@ discard block |
||
| 5422 | 5422 | * @param object $results An object containing all post ids. |
| 5423 | 5423 | * @param string $post_type Post type. |
| 5424 | 5424 | */ |
| 5425 | - return apply_filters( 'geodir_export_posts', $results, $post_type ); |
|
| 5425 | + return apply_filters('geodir_export_posts', $results, $post_type);
|
|
| 5426 | 5426 | } |
| 5427 | 5427 | |
| 5428 | 5428 | /** |
@@ -5440,24 +5440,24 @@ discard block |
||
| 5440 | 5440 | * @param string $post_type Post type. |
| 5441 | 5441 | * @return string The SQL query. |
| 5442 | 5442 | */ |
| 5443 | -function geodir_imex_get_events_query( $query, $post_type ) {
|
|
| 5444 | - if ( $post_type == 'gd_event' ) {
|
|
| 5443 | +function geodir_imex_get_events_query($query, $post_type) {
|
|
| 5444 | + if ($post_type == 'gd_event') {
|
|
| 5445 | 5445 | global $wpdb, $plugin_prefix; |
| 5446 | 5446 | |
| 5447 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 5447 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 5448 | 5448 | $schedule_table = EVENT_SCHEDULE; |
| 5449 | 5449 | |
| 5450 | 5450 | // Skip listing with statuses trash, auto-draft etc... |
| 5451 | 5451 | $skip_statuses = geodir_imex_export_skip_statuses(); |
| 5452 | 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 ) . "')";
|
|
| 5453 | + if (!empty($skip_statuses) && is_array($skip_statuses)) {
|
|
| 5454 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')";
|
|
| 5455 | 5455 | } |
| 5456 | 5456 | |
| 5457 | 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 ); |
|
| 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 );
|
|
| 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 | 5461 | } |
| 5462 | 5462 | |
| 5463 | 5463 | return $query; |
@@ -5481,35 +5481,35 @@ discard block |
||
| 5481 | 5481 | * @param string $post_type Post type. |
| 5482 | 5482 | * @return int Total terms count. |
| 5483 | 5483 | */ |
| 5484 | -function geodir_get_terms_count( $post_type ) {
|
|
| 5485 | - $args = array( 'hide_empty' => 0 ); |
|
| 5484 | +function geodir_get_terms_count($post_type) {
|
|
| 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 | 5491 | // WPML |
| 5492 | 5492 | $is_wpml = geodir_is_wpml(); |
| 5493 | 5493 | $active_lang = 'all'; |
| 5494 | - if ( $is_wpml ) {
|
|
| 5494 | + if ($is_wpml) {
|
|
| 5495 | 5495 | global $sitepress; |
| 5496 | 5496 | $active_lang = $sitepress->get_current_language(); |
| 5497 | 5497 | |
| 5498 | - if ( $active_lang != 'all' ) {
|
|
| 5499 | - $sitepress->switch_lang( 'all', true ); |
|
| 5498 | + if ($active_lang != 'all') {
|
|
| 5499 | + $sitepress->switch_lang('all', true);
|
|
| 5500 | 5500 | } |
| 5501 | 5501 | } |
| 5502 | 5502 | // WPML |
| 5503 | 5503 | |
| 5504 | - $count_terms = wp_count_terms( $taxonomy, $args ); |
|
| 5504 | + $count_terms = wp_count_terms($taxonomy, $args); |
|
| 5505 | 5505 | |
| 5506 | 5506 | // WPML |
| 5507 | - if ( $is_wpml && $active_lang !== 'all' ) {
|
|
| 5507 | + if ($is_wpml && $active_lang !== 'all') {
|
|
| 5508 | 5508 | global $sitepress; |
| 5509 | - $sitepress->switch_lang( $active_lang, true ); |
|
| 5509 | + $sitepress->switch_lang($active_lang, true); |
|
| 5510 | 5510 | } |
| 5511 | 5511 | // WPML |
| 5512 | - $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0; |
|
| 5512 | + $count_terms = !is_wp_error($count_terms) ? $count_terms : 0; |
|
| 5513 | 5513 | |
| 5514 | 5514 | return $count_terms; |
| 5515 | 5515 | } |
@@ -5526,23 +5526,23 @@ discard block |
||
| 5526 | 5526 | * @param int $page_no Page number. Default 0. |
| 5527 | 5527 | * @return array Array of terms data. |
| 5528 | 5528 | */ |
| 5529 | -function geodir_imex_get_terms( $post_type, $per_page = 0, $page_no = 0 ) {
|
|
| 5530 | - $args = array( 'hide_empty' => 0, 'orderby' => 'id' ); |
|
| 5529 | +function geodir_imex_get_terms($post_type, $per_page = 0, $page_no = 0) {
|
|
| 5530 | + $args = array('hide_empty' => 0, 'orderby' => 'id');
|
|
| 5531 | 5531 | |
| 5532 | - remove_all_filters( 'get_terms' ); |
|
| 5532 | + remove_all_filters('get_terms');
|
|
| 5533 | 5533 | |
| 5534 | - $taxonomy = $post_type . 'category'; |
|
| 5534 | + $taxonomy = $post_type.'category'; |
|
| 5535 | 5535 | |
| 5536 | - if ( $per_page > 0 && $page_no > 0 ) {
|
|
| 5537 | - $args['offset'] = ( $page_no - 1 ) * $per_page; |
|
| 5536 | + if ($per_page > 0 && $page_no > 0) {
|
|
| 5537 | + $args['offset'] = ($page_no - 1) * $per_page; |
|
| 5538 | 5538 | $args['number'] = $per_page; |
| 5539 | 5539 | } |
| 5540 | 5540 | |
| 5541 | - $terms = get_terms( $taxonomy, $args ); |
|
| 5541 | + $terms = get_terms($taxonomy, $args); |
|
| 5542 | 5542 | |
| 5543 | 5543 | $csv_rows = array(); |
| 5544 | 5544 | |
| 5545 | - if ( !empty( $terms ) ) {
|
|
| 5545 | + if (!empty($terms)) {
|
|
| 5546 | 5546 | $csv_row = array(); |
| 5547 | 5547 | $csv_row[] = 'cat_id'; |
| 5548 | 5548 | $csv_row[] = 'cat_name'; |
@@ -5564,16 +5564,16 @@ discard block |
||
| 5564 | 5564 | |
| 5565 | 5565 | $csv_rows[] = $csv_row; |
| 5566 | 5566 | |
| 5567 | - foreach ( $terms as $term ) {
|
|
| 5568 | - $cat_icon = get_tax_meta( $term->term_id, 'ct_cat_icon', false, $post_type ); |
|
| 5569 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
| 5567 | + foreach ($terms as $term) {
|
|
| 5568 | + $cat_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $post_type); |
|
| 5569 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
| 5570 | 5570 | |
| 5571 | - $cat_image = geodir_get_default_catimage( $term->term_id, $post_type ); |
|
| 5572 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
| 5571 | + $cat_image = geodir_get_default_catimage($term->term_id, $post_type); |
|
| 5572 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
| 5573 | 5573 | |
| 5574 | 5574 | $cat_parent = ''; |
| 5575 | - if (isset($term->parent) && (int)$term->parent > 0 && term_exists((int)$term->parent, $taxonomy)) {
|
|
| 5576 | - $parent_term = (array)get_term_by( 'id', (int)$term->parent, $taxonomy ); |
|
| 5575 | + if (isset($term->parent) && (int) $term->parent > 0 && term_exists((int) $term->parent, $taxonomy)) {
|
|
| 5576 | + $parent_term = (array) get_term_by('id', (int) $term->parent, $taxonomy);
|
|
| 5577 | 5577 | $cat_parent = !empty($parent_term) && isset($parent_term['name']) ? $parent_term['name'] : ''; |
| 5578 | 5578 | } |
| 5579 | 5579 | |
@@ -5583,15 +5583,15 @@ discard block |
||
| 5583 | 5583 | $csv_row[] = $term->slug; |
| 5584 | 5584 | $csv_row[] = $post_type; |
| 5585 | 5585 | $csv_row[] = $cat_parent; |
| 5586 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type ); |
|
| 5586 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_schema', false, $post_type); |
|
| 5587 | 5587 | // WPML |
| 5588 | 5588 | if ($is_wpml) {
|
| 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 ); |
|
| 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); |
|
| 5591 | 5591 | } |
| 5592 | 5592 | // WPML |
| 5593 | 5593 | $csv_row[] = $term->description; |
| 5594 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_top_desc', false, $post_type ); |
|
| 5594 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_top_desc', false, $post_type); |
|
| 5595 | 5595 | $csv_row[] = $cat_image; |
| 5596 | 5596 | $csv_row[] = $cat_icon; |
| 5597 | 5597 | |
@@ -5610,10 +5610,10 @@ discard block |
||
| 5610 | 5610 | * @param bool $relative True for relative path & False for absolute path. |
| 5611 | 5611 | * @return string Path to the cache directory. |
| 5612 | 5612 | */ |
| 5613 | -function geodir_path_import_export( $relative = true ) {
|
|
| 5613 | +function geodir_path_import_export($relative = true) {
|
|
| 5614 | 5614 | $upload_dir = wp_upload_dir(); |
| 5615 | 5615 | |
| 5616 | - return $relative ? $upload_dir['baseurl'] . '/cache' : $upload_dir['basedir'] . '/cache'; |
|
| 5616 | + return $relative ? $upload_dir['baseurl'].'/cache' : $upload_dir['basedir'].'/cache'; |
|
| 5617 | 5617 | } |
| 5618 | 5618 | |
| 5619 | 5619 | /** |
@@ -5629,8 +5629,8 @@ discard block |
||
| 5629 | 5629 | * @param bool $clear If true then it overwrite data otherwise add rows at the end of file. |
| 5630 | 5630 | * @return bool true if success otherwise false. |
| 5631 | 5631 | */ |
| 5632 | -function geodir_save_csv_data( $file_path, $csv_data = array(), $clear = true ) {
|
|
| 5633 | - if ( empty( $csv_data ) ) {
|
|
| 5632 | +function geodir_save_csv_data($file_path, $csv_data = array(), $clear = true) {
|
|
| 5633 | + if (empty($csv_data)) {
|
|
| 5634 | 5634 | return false; |
| 5635 | 5635 | } |
| 5636 | 5636 | |
@@ -5638,17 +5638,17 @@ discard block |
||
| 5638 | 5638 | |
| 5639 | 5639 | $mode = $clear ? 'w+' : 'a+'; |
| 5640 | 5640 | |
| 5641 | - if ( function_exists( 'fputcsv' ) ) {
|
|
| 5642 | - $file = fopen( $file_path, $mode ); |
|
| 5643 | - foreach( $csv_data as $csv_row ) {
|
|
| 5641 | + if (function_exists('fputcsv')) {
|
|
| 5642 | + $file = fopen($file_path, $mode); |
|
| 5643 | + foreach ($csv_data as $csv_row) {
|
|
| 5644 | 5644 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
| 5645 | - $write_successful = fputcsv( $file, $csv_row, ",", $enclosure = '"' ); |
|
| 5645 | + $write_successful = fputcsv($file, $csv_row, ",", $enclosure = '"'); |
|
| 5646 | 5646 | } |
| 5647 | - fclose( $file ); |
|
| 5647 | + fclose($file); |
|
| 5648 | 5648 | } else {
|
| 5649 | - foreach( $csv_data as $csv_row ) {
|
|
| 5649 | + foreach ($csv_data as $csv_row) {
|
|
| 5650 | 5650 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
| 5651 | - $wp_filesystem->put_contents( $file_path, $csv_row ); |
|
| 5651 | + $wp_filesystem->put_contents($file_path, $csv_row); |
|
| 5652 | 5652 | } |
| 5653 | 5653 | } |
| 5654 | 5654 | |
@@ -5666,14 +5666,14 @@ discard block |
||
| 5666 | 5666 | * @param string $file Full path to file. |
| 5667 | 5667 | * @return int No of file rows. |
| 5668 | 5668 | */ |
| 5669 | -function geodir_import_export_line_count( $file ) {
|
|
| 5669 | +function geodir_import_export_line_count($file) {
|
|
| 5670 | 5670 | global $wp_filesystem; |
| 5671 | 5671 | |
| 5672 | - if ( $wp_filesystem->is_file( $file ) && $wp_filesystem->exists( $file ) ) {
|
|
| 5673 | - $contents = $wp_filesystem->get_contents_array( $file ); |
|
| 5672 | + if ($wp_filesystem->is_file($file) && $wp_filesystem->exists($file)) {
|
|
| 5673 | + $contents = $wp_filesystem->get_contents_array($file); |
|
| 5674 | 5674 | |
| 5675 | - if ( !empty( $contents ) && is_array( $contents ) ) {
|
|
| 5676 | - return count( $contents ) - 1; |
|
| 5675 | + if (!empty($contents) && is_array($contents)) {
|
|
| 5676 | + return count($contents) - 1; |
|
| 5677 | 5677 | } |
| 5678 | 5678 | } |
| 5679 | 5679 | |
@@ -5690,11 +5690,11 @@ discard block |
||
| 5690 | 5690 | * @param string $post_type The post type. |
| 5691 | 5691 | * @return object Queried object. |
| 5692 | 5692 | */ |
| 5693 | -function geodir_imex_get_custom_fields( $post_type ) {
|
|
| 5693 | +function geodir_imex_get_custom_fields($post_type) {
|
|
| 5694 | 5694 | global $wpdb; |
| 5695 | 5695 | |
| 5696 | - $sql = $wpdb->prepare("SELECT htmlvar_name FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array( $post_type ) );
|
|
| 5697 | - $rows = $wpdb->get_results( $sql ); |
|
| 5696 | + $sql = $wpdb->prepare("SELECT htmlvar_name FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array($post_type));
|
|
| 5697 | + $rows = $wpdb->get_results($sql); |
|
| 5698 | 5698 | |
| 5699 | 5699 | return $rows; |
| 5700 | 5700 | } |
@@ -5773,14 +5773,14 @@ discard block |
||
| 5773 | 5773 | global $wpdb, $plugin_prefix; |
| 5774 | 5774 | |
| 5775 | 5775 | $post_type = get_post_type($master_post_id); |
| 5776 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
| 5776 | + $post_table = $plugin_prefix.$post_type.'_detail'; |
|
| 5777 | 5777 | |
| 5778 | - $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id));
|
|
| 5779 | - $data = (array)$wpdb->get_row($query); |
|
| 5778 | + $query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id));
|
|
| 5779 | + $data = (array) $wpdb->get_row($query); |
|
| 5780 | 5780 | |
| 5781 | - if ( !empty( $data ) ) {
|
|
| 5781 | + if (!empty($data)) {
|
|
| 5782 | 5782 | $data['post_id'] = $tr_post_id; |
| 5783 | - unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
| 5783 | + unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
| 5784 | 5784 | |
| 5785 | 5785 | $wpdb->update($post_table, $data, array('post_id' => $tr_post_id));
|
| 5786 | 5786 | return true; |
@@ -5806,7 +5806,7 @@ discard block |
||
| 5806 | 5806 | global $sitepress, $wpdb; |
| 5807 | 5807 | $post_type = get_post_type($master_post_id); |
| 5808 | 5808 | |
| 5809 | - remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language
|
|
| 5809 | + remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language
|
|
| 5810 | 5810 | |
| 5811 | 5811 | $taxonomies = get_object_taxonomies($post_type); |
| 5812 | 5812 | foreach ($taxonomies as $taxonomy) {
|
@@ -5815,9 +5815,9 @@ discard block |
||
| 5815 | 5815 | |
| 5816 | 5816 | if ($terms) {
|
| 5817 | 5817 | foreach ($terms as $term) {
|
| 5818 | - $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
| 5818 | + $tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang);
|
|
| 5819 | 5819 | |
| 5820 | - if (!is_null($tr_id)){
|
|
| 5820 | + if (!is_null($tr_id)) {
|
|
| 5821 | 5821 | // not using get_term - unfiltered get_term |
| 5822 | 5822 | $translated_term = $wpdb->get_row($wpdb->prepare("
|
| 5823 | 5823 | SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy));
|
@@ -5826,14 +5826,14 @@ discard block |
||
| 5826 | 5826 | } |
| 5827 | 5827 | } |
| 5828 | 5828 | |
| 5829 | - if (!is_taxonomy_hierarchical($taxonomy)){
|
|
| 5830 | - $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
| 5829 | + if (!is_taxonomy_hierarchical($taxonomy)) {
|
|
| 5830 | + $terms_array = array_unique(array_map('intval', $terms_array));
|
|
| 5831 | 5831 | } |
| 5832 | 5832 | |
| 5833 | 5833 | wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
| 5834 | 5834 | |
| 5835 | - if ($taxonomy == $post_type . 'category') {
|
|
| 5836 | - geodir_set_postcat_structure($tr_post_id, $post_type . 'category'); |
|
| 5835 | + if ($taxonomy == $post_type.'category') {
|
|
| 5836 | + geodir_set_postcat_structure($tr_post_id, $post_type.'category'); |
|
| 5837 | 5837 | } |
| 5838 | 5838 | } |
| 5839 | 5839 | } |
@@ -5854,15 +5854,15 @@ discard block |
||
| 5854 | 5854 | function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) {
|
| 5855 | 5855 | global $wpdb; |
| 5856 | 5856 | |
| 5857 | - $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
|
|
| 5857 | + $query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
|
|
| 5858 | 5858 | $wpdb->query($query); |
| 5859 | 5859 | |
| 5860 | - $query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
|
|
| 5860 | + $query = $wpdb->prepare("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
|
|
| 5861 | 5861 | $post_images = $wpdb->get_results($query); |
| 5862 | 5862 | |
| 5863 | - if ( !empty( $post_images ) ) {
|
|
| 5864 | - foreach ( $post_images as $post_image) {
|
|
| 5865 | - $image_data = (array)$post_image; |
|
| 5863 | + if (!empty($post_images)) {
|
|
| 5864 | + foreach ($post_images as $post_image) {
|
|
| 5865 | + $image_data = (array) $post_image; |
|
| 5866 | 5866 | unset($image_data['ID']); |
| 5867 | 5867 | $image_data['post_id'] = $tr_post_id; |
| 5868 | 5868 | |
@@ -5888,10 +5888,10 @@ discard block |
||
| 5888 | 5888 | * @return array Event data array. |
| 5889 | 5889 | */ |
| 5890 | 5890 | function geodir_imex_get_event_data($post, $gd_post_info) {
|
| 5891 | - $event_date = isset( $post['event_date'] ) && $post['event_date'] != '' && $post['event_date'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $post['event_date'] ) ) : ''; |
|
| 5891 | + $event_date = isset($post['event_date']) && $post['event_date'] != '' && $post['event_date'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($post['event_date'])) : '';
|
|
| 5892 | 5892 | $event_enddate = $event_date; |
| 5893 | - $starttime = isset( $post['starttime'] ) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['starttime'] ) ) : ''; |
|
| 5894 | - $endtime = isset( $post['endtime'] ) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['endtime'] ) ) : ''; |
|
| 5893 | + $starttime = isset($post['starttime']) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['starttime'])) : '';
|
|
| 5894 | + $endtime = isset($post['endtime']) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['endtime'])) : '';
|
|
| 5895 | 5895 | |
| 5896 | 5896 | $is_recurring_event = ''; |
| 5897 | 5897 | $event_duration_days = ''; |
@@ -5908,15 +5908,15 @@ discard block |
||
| 5908 | 5908 | |
| 5909 | 5909 | $recurring_data = isset($gd_post_info->recurring_dates) ? maybe_unserialize($gd_post_info->recurring_dates) : array(); |
| 5910 | 5910 | if (!empty($recurring_data)) {
|
| 5911 | - $event_date = isset( $recurring_data['event_start'] ) && $recurring_data['event_start'] != '' && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['event_start'] ) ) : $event_date; |
|
| 5912 | - $event_enddate = isset( $recurring_data['event_end'] ) && $recurring_data['event_end'] != '' && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['event_end'] ) ) : $event_date; |
|
| 5913 | - $starttime = isset( $recurring_data['starttime'] ) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['starttime'] ) ) : $starttime; |
|
| 5914 | - $endtime = isset( $recurring_data['endtime'] ) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['endtime'] ) ) : $endtime; |
|
| 5911 | + $event_date = isset($recurring_data['event_start']) && $recurring_data['event_start'] != '' && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['event_start'])) : $event_date;
|
|
| 5912 | + $event_enddate = isset($recurring_data['event_end']) && $recurring_data['event_end'] != '' && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['event_end'])) : $event_date;
|
|
| 5913 | + $starttime = isset($recurring_data['starttime']) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['starttime'])) : $starttime;
|
|
| 5914 | + $endtime = isset($recurring_data['endtime']) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['endtime'])) : $endtime;
|
|
| 5915 | 5915 | $is_whole_day_event = !empty($recurring_data['all_day']) ? 1 : ''; |
| 5916 | 5916 | $different_times = !empty($recurring_data['different_times']) ? true : false; |
| 5917 | 5917 | |
| 5918 | - $recurring_pkg = geodir_event_recurring_pkg( $gd_post_info ); |
|
| 5919 | - $is_recurring = isset( $gd_post_info->is_recurring ) && (int)$gd_post_info->is_recurring == 0 ? false : true; |
|
| 5918 | + $recurring_pkg = geodir_event_recurring_pkg($gd_post_info); |
|
| 5919 | + $is_recurring = isset($gd_post_info->is_recurring) && (int) $gd_post_info->is_recurring == 0 ? false : true; |
|
| 5920 | 5920 | |
| 5921 | 5921 | if ($recurring_pkg && $is_recurring) {
|
| 5922 | 5922 | $recurring_dates = $event_date; |
@@ -5926,13 +5926,13 @@ discard block |
||
| 5926 | 5926 | $recurring_type = !empty($recurring_data['repeat_type']) && in_array($recurring_data['repeat_type'], array('day', 'week', 'month', 'year', 'custom')) ? $recurring_data['repeat_type'] : 'custom';
|
| 5927 | 5927 | |
| 5928 | 5928 | if (!empty($recurring_data['event_recurring_dates'])) {
|
| 5929 | - $event_recurring_dates = explode( ',', $recurring_data['event_recurring_dates'] ); |
|
| 5929 | + $event_recurring_dates = explode(',', $recurring_data['event_recurring_dates']);
|
|
| 5930 | 5930 | |
| 5931 | 5931 | if (!empty($event_recurring_dates)) {
|
| 5932 | 5932 | $recurring_dates = array(); |
| 5933 | 5933 | |
| 5934 | 5934 | foreach ($event_recurring_dates as $date) {
|
| 5935 | - $recurring_dates[] = date_i18n( 'd/m/Y', strtotime( $date ) ); |
|
| 5935 | + $recurring_dates[] = date_i18n('d/m/Y', strtotime($date));
|
|
| 5936 | 5936 | } |
| 5937 | 5937 | |
| 5938 | 5938 | $recurring_dates = implode(",", $recurring_dates);
|
@@ -5948,7 +5948,7 @@ discard block |
||
| 5948 | 5948 | $times = array(); |
| 5949 | 5949 | |
| 5950 | 5950 | foreach ($recurring_data['starttimes'] as $time) {
|
| 5951 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
| 5951 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00';
|
|
| 5952 | 5952 | } |
| 5953 | 5953 | |
| 5954 | 5954 | $event_starttimes = implode(",", $times);
|
@@ -5958,7 +5958,7 @@ discard block |
||
| 5958 | 5958 | $times = array(); |
| 5959 | 5959 | |
| 5960 | 5960 | foreach ($recurring_data['endtimes'] as $time) {
|
| 5961 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
| 5961 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00';
|
|
| 5962 | 5962 | } |
| 5963 | 5963 | |
| 5964 | 5964 | $event_endtimes = implode(",", $times);
|
@@ -5970,8 +5970,8 @@ discard block |
||
| 5970 | 5970 | } |
| 5971 | 5971 | } |
| 5972 | 5972 | } else {
|
| 5973 | - $event_duration_days = isset($recurring_data['duration_x']) ? (int)$recurring_data['duration_x'] : 1; |
|
| 5974 | - $recurring_interval = !empty($recurring_data['repeat_x']) && (int)$recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
| 5973 | + $event_duration_days = isset($recurring_data['duration_x']) ? (int) $recurring_data['duration_x'] : 1; |
|
| 5974 | + $recurring_interval = !empty($recurring_data['repeat_x']) && (int) $recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
| 5975 | 5975 | |
| 5976 | 5976 | if (($recurring_type == 'week' || $recurring_type == 'month') && !empty($recurring_data['repeat_days'])) {
|
| 5977 | 5977 | $week_days = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
|
@@ -5987,11 +5987,11 @@ discard block |
||
| 5987 | 5987 | } |
| 5988 | 5988 | |
| 5989 | 5989 | $recurring_week_nos = $recurring_type == 'month' && !empty($recurring_data['repeat_weeks']) ? implode(",", $recurring_data['repeat_weeks']) : $recurring_week_nos;
|
| 5990 | - if (!empty($recurring_data['repeat_end_type']) && (int)$recurring_data['repeat_end_type'] == 1) {
|
|
| 5991 | - $recurring_end_date = isset($recurring_data['repeat_end']) && $recurring_data['repeat_end'] != '' && $recurring_data['repeat_end'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['repeat_end'] ) ) : ''; |
|
| 5990 | + if (!empty($recurring_data['repeat_end_type']) && (int) $recurring_data['repeat_end_type'] == 1) {
|
|
| 5991 | + $recurring_end_date = isset($recurring_data['repeat_end']) && $recurring_data['repeat_end'] != '' && $recurring_data['repeat_end'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['repeat_end'])) : '';
|
|
| 5992 | 5992 | $max_recurring_count = empty($recurring_end_date) ? 1 : ''; |
| 5993 | 5993 | } else {
|
| 5994 | - $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int)$recurring_data['max_repeat'] > 0 ? (int)$recurring_data['max_repeat'] : 1); |
|
| 5994 | + $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int) $recurring_data['max_repeat'] > 0 ? (int) $recurring_data['max_repeat'] : 1); |
|
| 5995 | 5995 | } |
| 5996 | 5996 | } |
| 5997 | 5997 | } |
@@ -6055,9 +6055,9 @@ discard block |
||
| 6055 | 6055 | * @return array Event data array. |
| 6056 | 6056 | */ |
| 6057 | 6057 | function geodir_imex_process_event_data($gd_post) {
|
| 6058 | - $recurring_pkg = geodir_event_recurring_pkg( (object)$gd_post ); |
|
| 6058 | + $recurring_pkg = geodir_event_recurring_pkg((object) $gd_post); |
|
| 6059 | 6059 | |
| 6060 | - $is_recurring = isset( $gd_post['is_recurring_event'] ) && (int)$gd_post['is_recurring_event'] == 0 ? false : true; |
|
| 6060 | + $is_recurring = isset($gd_post['is_recurring_event']) && (int) $gd_post['is_recurring_event'] == 0 ? false : true; |
|
| 6061 | 6061 | $event_date = isset($gd_post['event_date']) && $gd_post['event_date'] != '' ? geodir_imex_get_date_ymd($gd_post['event_date']) : ''; |
| 6062 | 6062 | $event_enddate = isset($gd_post['event_enddate']) && $gd_post['event_enddate'] != '' ? geodir_imex_get_date_ymd($gd_post['event_enddate']) : $event_date; |
| 6063 | 6063 | $all_day = isset($gd_post['is_whole_day_event']) && !empty($gd_post['is_whole_day_event']) ? true : false; |
@@ -6104,17 +6104,17 @@ discard block |
||
| 6104 | 6104 | $event_recurring_dates = implode(",", $event_recurring_dates);
|
| 6105 | 6105 | } |
| 6106 | 6106 | } else {
|
| 6107 | - $duration_x = !empty( $gd_post['event_duration_days'] ) ? (int)$gd_post['event_duration_days'] : 1; |
|
| 6108 | - $repeat_x = !empty( $gd_post['recurring_interval'] ) ? (int)$gd_post['recurring_interval'] : 1; |
|
| 6109 | - $max_repeat = !empty( $gd_post['max_recurring_count'] ) ? (int)$gd_post['max_recurring_count'] : 1; |
|
| 6110 | - $repeat_end = !empty( $gd_post['recurring_end_date'] ) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
| 6107 | + $duration_x = !empty($gd_post['event_duration_days']) ? (int) $gd_post['event_duration_days'] : 1; |
|
| 6108 | + $repeat_x = !empty($gd_post['recurring_interval']) ? (int) $gd_post['recurring_interval'] : 1; |
|
| 6109 | + $max_repeat = !empty($gd_post['max_recurring_count']) ? (int) $gd_post['max_recurring_count'] : 1; |
|
| 6110 | + $repeat_end = !empty($gd_post['recurring_end_date']) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
| 6111 | 6111 | |
| 6112 | 6112 | $repeat_end_type = $repeat_end != '' ? 1 : 0; |
| 6113 | 6113 | $max_repeat = $repeat_end != '' ? '' : $max_repeat; |
| 6114 | 6114 | |
| 6115 | 6115 | $week_days = array_flip(array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'));
|
| 6116 | 6116 | |
| 6117 | - $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days'])!='' ? explode(',', trim($gd_post['recurring_week_days'])) : array();
|
|
| 6117 | + $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days']) != '' ? explode(',', trim($gd_post['recurring_week_days'])) : array();
|
|
| 6118 | 6118 | $repeat_days = array(); |
| 6119 | 6119 | if (!empty($a_repeat_days)) {
|
| 6120 | 6120 | foreach ($a_repeat_days as $repeat_day) {
|
@@ -6132,7 +6132,7 @@ discard block |
||
| 6132 | 6132 | $repeat_weeks = array(); |
| 6133 | 6133 | if (!empty($a_repeat_weeks)) {
|
| 6134 | 6134 | foreach ($a_repeat_weeks as $repeat_week) {
|
| 6135 | - $repeat_weeks[] = (int)$repeat_week; |
|
| 6135 | + $repeat_weeks[] = (int) $repeat_week; |
|
| 6136 | 6136 | } |
| 6137 | 6137 | |
| 6138 | 6138 | $repeat_weeks = array_unique($repeat_weeks); |
@@ -6196,7 +6196,7 @@ discard block |
||
| 6196 | 6196 | |
| 6197 | 6197 | $page_found = $wpdb->get_var( |
| 6198 | 6198 | $wpdb->prepare( |
| 6199 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", |
|
| 6199 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;", |
|
| 6200 | 6200 | array($slug) |
| 6201 | 6201 | ) |
| 6202 | 6202 | ); |
@@ -6251,7 +6251,7 @@ discard block |
||
| 6251 | 6251 | */ |
| 6252 | 6252 | function geodir_admin_upgrade_notice() {
|
| 6253 | 6253 | $class = "error"; |
| 6254 | - $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
|
|
| 6254 | + $message = __("Please update core GeoDirectory or some addons may not function correctly.", "geodirectory");
|
|
| 6255 | 6255 | echo"<div class=\"$class\"> <p>$message</p></div>"; |
| 6256 | 6256 | } |
| 6257 | 6257 | |
@@ -6263,7 +6263,7 @@ discard block |
||
| 6263 | 6263 | * @param (object) $r |
| 6264 | 6264 | * @return (string) $output |
| 6265 | 6265 | */ |
| 6266 | -function geodire_admin_upgrade_notice( $plugin_data, $r ) |
|
| 6266 | +function geodire_admin_upgrade_notice($plugin_data, $r) |
|
| 6267 | 6267 | {
|
| 6268 | 6268 | // readme contents |
| 6269 | 6269 | $args = array( |
@@ -6271,7 +6271,7 @@ discard block |
||
| 6271 | 6271 | 'redirection' => 5 |
| 6272 | 6272 | ); |
| 6273 | 6273 | $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt"; |
| 6274 | - $data = wp_remote_get( $url, $args ); |
|
| 6274 | + $data = wp_remote_get($url, $args); |
|
| 6275 | 6275 | |
| 6276 | 6276 | if (!is_wp_error($data) && $data['response']['code'] == 200) {
|
| 6277 | 6277 | |
@@ -6286,20 +6286,20 @@ discard block |
||
| 6286 | 6286 | function geodir_in_plugin_update_message($content) {
|
| 6287 | 6287 | // Output Upgrade Notice |
| 6288 | 6288 | $matches = null; |
| 6289 | - $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis'; |
|
| 6289 | + $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*'.preg_quote(GEODIRECTORY_VERSION).'\s*=|$)~Uis'; |
|
| 6290 | 6290 | $upgrade_notice = ''; |
| 6291 | - if ( preg_match( $regexp, $content, $matches ) ) {
|
|
| 6292 | - if(empty($matches)){return;}
|
|
| 6291 | + if (preg_match($regexp, $content, $matches)) {
|
|
| 6292 | + if (empty($matches)) {return; }
|
|
| 6293 | 6293 | |
| 6294 | - $version = trim( $matches[1] ); |
|
| 6295 | - if($version && $version>GEODIRECTORY_VERSION){
|
|
| 6294 | + $version = trim($matches[1]); |
|
| 6295 | + if ($version && $version > GEODIRECTORY_VERSION) {
|
|
| 6296 | 6296 | |
| 6297 | 6297 | |
| 6298 | - $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
|
|
| 6299 | - if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) {
|
|
| 6298 | + $notices = (array) preg_split('~[\r\n]+~', trim($matches[2]));
|
|
| 6299 | + if (version_compare(GEODIRECTORY_VERSION, $version, '<')) {
|
|
| 6300 | 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 ) );
|
|
| 6301 | + foreach ($notices as $index => $line) {
|
|
| 6302 | + $upgrade_notice .= wp_kses_post(preg_replace('~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line));
|
|
| 6303 | 6303 | } |
| 6304 | 6304 | $upgrade_notice .= '</div> '; |
| 6305 | 6305 | } |
@@ -6323,7 +6323,7 @@ discard block |
||
| 6323 | 6323 | $default_language = $sitepress->get_default_language(); |
| 6324 | 6324 | if ($current_language != 'all' && $current_language != $default_language) {
|
| 6325 | 6325 | ?> |
| 6326 | - <div class="updated error notice-success" id="message"><p style="color:red"><strong><?php _e('Saving GeoDirectory pages settings on a different language breaks pages settings. Try to save after switching to default language.', 'geodirectory');?></strong></p></div>
|
|
| 6326 | + <div class="updated error notice-success" id="message"><p style="color:red"><strong><?php _e('Saving GeoDirectory pages settings on a different language breaks pages settings. Try to save after switching to default language.', 'geodirectory'); ?></strong></p></div>
|
|
| 6327 | 6327 | <?php |
| 6328 | 6328 | } |
| 6329 | 6329 | } |
@@ -6338,7 +6338,7 @@ 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 | 6343 | /** |
| 6344 | 6344 | * Filter the statuses to skip during GD export listings. |
@@ -6348,7 +6348,7 @@ discard block |
||
| 6348 | 6348 | * |
| 6349 | 6349 | * @param array $statuses Listing statuses to be skipped. |
| 6350 | 6350 | */ |
| 6351 | - $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses ); |
|
| 6351 | + $statuses = apply_filters('geodir_imex_export_skip_statuses', $statuses);
|
|
| 6352 | 6352 | |
| 6353 | 6353 | return $statuses; |
| 6354 | 6354 | } |
@@ -6388,16 +6388,16 @@ discard block |
||
| 6388 | 6388 | function geodir_imex_get_filter_where($where = '', $post_type = '') {
|
| 6389 | 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 ) {
|
|
| 6393 | + if (!empty($filters)) {
|
|
| 6394 | + foreach ($filters as $field => $value) {
|
|
| 6395 | 6395 | switch ($field) {
|
| 6396 | 6396 | case 'start_date': |
| 6397 | - $where .= " AND `" . $wpdb->posts . "`.`post_date` >= '" . sanitize_text_field( $value ) . " 00:00:00'"; |
|
| 6397 | + $where .= " AND `".$wpdb->posts."`.`post_date` >= '".sanitize_text_field($value)." 00:00:00'"; |
|
| 6398 | 6398 | break; |
| 6399 | 6399 | case 'end_date': |
| 6400 | - $where .= " AND `" . $wpdb->posts . "`.`post_date` <= '" . sanitize_text_field( $value ) . " 23:59:59'"; |
|
| 6400 | + $where .= " AND `".$wpdb->posts."`.`post_date` <= '".sanitize_text_field($value)." 23:59:59'"; |
|
| 6401 | 6401 | break; |
| 6402 | 6402 | } |
| 6403 | 6403 | } |
@@ -6409,25 +6409,25 @@ discard block |
||
| 6409 | 6409 | add_filter('geodir_get_export_posts', 'geodir_imex_get_filter_where', 10, 2);
|
| 6410 | 6410 | |
| 6411 | 6411 | |
| 6412 | -function geodir_fix_for_primer_theme(){
|
|
| 6413 | - if(!defined( 'PRIMER_VERSION' )){return;}
|
|
| 6412 | +function geodir_fix_for_primer_theme() {
|
|
| 6413 | + if (!defined('PRIMER_VERSION')) {return; }
|
|
| 6414 | 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 | 6420 | $post_types = geodir_get_posttypes(); |
| 6421 | - if ($post_type && in_array($post_type, $post_types) ) {
|
|
| 6421 | + if ($post_type && in_array($post_type, $post_types)) {
|
|
| 6422 | 6422 | global $primer_customizer_layouts; |
| 6423 | - remove_action( 'add_meta_boxes', array( $primer_customizer_layouts, 'add_meta_box' ), 10); |
|
| 6423 | + remove_action('add_meta_boxes', array($primer_customizer_layouts, 'add_meta_box'), 10);
|
|
| 6424 | 6424 | } |
| 6425 | 6425 | } |
| 6426 | 6426 | |
| 6427 | 6427 | } |
| 6428 | 6428 | |
| 6429 | -if(is_admin()){
|
|
| 6430 | - add_action('add_meta_boxes','geodir_fix_for_primer_theme',0);
|
|
| 6429 | +if (is_admin()) {
|
|
| 6430 | + add_action('add_meta_boxes', 'geodir_fix_for_primer_theme', 0);
|
|
| 6431 | 6431 | } |
| 6432 | 6432 | |
| 6433 | 6433 | |
@@ -6560,27 +6560,27 @@ discard block |
||
| 6560 | 6560 | |
| 6561 | 6561 | function geodir_ga_activation_url() {
|
| 6562 | 6562 | |
| 6563 | - return add_query_arg( array( |
|
| 6563 | + return add_query_arg(array( |
|
| 6564 | 6564 | 'next' => admin_url("admin.php?page=geodirectory&active_tab=google_analytic_settings"),
|
| 6565 | 6565 | 'scope' => GEODIR_GA_SCOPE, |
| 6566 | 6566 | 'response_type' => 'code', |
| 6567 | 6567 | 'redirect_uri' => GEODIR_GA_REDIRECT, |
| 6568 | 6568 | 'client_id' => GEODIR_GA_CLIENTID, |
| 6569 | - ), 'https://accounts.google.com/o/oauth2/auth' ); |
|
| 6569 | + ), 'https://accounts.google.com/o/oauth2/auth'); |
|
| 6570 | 6570 | |
| 6571 | 6571 | return $url; |
| 6572 | 6572 | } |
| 6573 | 6573 | |
| 6574 | -function geodir_gd_accounts(){
|
|
| 6574 | +function geodir_gd_accounts() {
|
|
| 6575 | 6575 | $accounts = array(); |
| 6576 | - $useAuth = ( get_option( 'geodir_ga_auth_code' ) == '' ? false : true ); |
|
| 6577 | - if($useAuth){
|
|
| 6576 | + $useAuth = (get_option('geodir_ga_auth_code') == '' ? false : true);
|
|
| 6577 | + if ($useAuth) {
|
|
| 6578 | 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')){
|
|
| 6579 | + if (is_array($accounts)) {
|
|
| 6580 | + $accounts = array_merge(array(__('Select Account', 'geodirectory')), $accounts);
|
|
| 6581 | + }elseif (get_option('geodir_ga_account_id')) {
|
|
| 6582 | 6582 | $accounts = array(); |
| 6583 | - $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required','geodirectory').' ('.get_option('geodir_ga_account_id').')';
|
|
| 6583 | + $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required', 'geodirectory').' ('.get_option('geodir_ga_account_id').')';
|
|
| 6584 | 6584 | } |
| 6585 | 6585 | } |
| 6586 | 6586 | return $accounts; |
@@ -6590,32 +6590,32 @@ discard block |
||
| 6590 | 6590 | {
|
| 6591 | 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'])){
|
|
| 6596 | + if (get_option('geodir_gd_uids') && !isset($_POST['geodir_ga_auth_code'])) {
|
|
| 6597 | 6597 | return get_option('geodir_gd_uids');
|
| 6598 | 6598 | } |
| 6599 | 6599 | |
| 6600 | 6600 | |
| 6601 | 6601 | # Create a new Gdata call |
| 6602 | - if ( trim(get_option('geodir_ga_auth_code')) != '' )
|
|
| 6602 | + if (trim(get_option('geodir_ga_auth_code')) != '')
|
|
| 6603 | 6603 | $stats = new GDGoogleAnalyticsStats(); |
| 6604 | 6604 | else |
| 6605 | 6605 | return false; |
| 6606 | 6606 | |
| 6607 | 6607 | # Check if Google sucessfully logged in |
| 6608 | - if ( ! $stats->checkLogin() ) |
|
| 6608 | + if (!$stats->checkLogin()) |
|
| 6609 | 6609 | return false; |
| 6610 | 6610 | |
| 6611 | 6611 | # Get a list of accounts |
| 6612 | 6612 | $accounts = $stats->getAllProfiles(); |
| 6613 | 6613 | |
| 6614 | - natcasesort ($accounts); |
|
| 6614 | + natcasesort($accounts); |
|
| 6615 | 6615 | |
| 6616 | 6616 | # Return the account array if there are accounts |
| 6617 | - if ( count($accounts) > 0 ){
|
|
| 6618 | - update_option('geodir_gd_uids',$accounts);
|
|
| 6617 | + if (count($accounts) > 0) {
|
|
| 6618 | + update_option('geodir_gd_uids', $accounts);
|
|
| 6619 | 6619 | return $accounts; |
| 6620 | 6620 | } |
| 6621 | 6621 | else |
@@ -184,8 +184,9 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | $thumb_img_arr = array(); |
| 186 | 186 | |
| 187 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 188 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 187 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
| 188 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 189 | + } |
|
| 189 | 190 | |
| 190 | 191 | $totImg = ''; |
| 191 | 192 | $image_limit = ''; |
@@ -236,7 +237,9 @@ discard block |
||
| 236 | 237 | {
|
| 237 | 238 | global $menu, $geodirectory; |
| 238 | 239 | |
| 239 | - if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory');
|
|
| 240 | + if (current_user_can('manage_options')) { |
|
| 241 | + $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory'); |
|
| 242 | + } |
|
| 240 | 243 | |
| 241 | 244 | add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984');
|
| 242 | 245 | |
@@ -300,7 +303,9 @@ discard block |
||
| 300 | 303 | */ |
| 301 | 304 | function geodir_admin_custom_menu_order() |
| 302 | 305 | {
|
| 303 | - if (!current_user_can('manage_options')) return false;
|
|
| 306 | + if (!current_user_can('manage_options')) { |
|
| 307 | + return false; |
|
| 308 | + } |
|
| 304 | 309 | return true; |
| 305 | 310 | } |
| 306 | 311 | } |
@@ -331,10 +336,11 @@ discard block |
||
| 331 | 336 | case 'fail': |
| 332 | 337 | $gderr = isset($_REQUEST['gderr']) ? $_REQUEST['gderr'] : ''; |
| 333 | 338 | |
| 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>';
|
|
| 336 | - else |
|
| 337 | - echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>';
|
|
| 339 | + if ($gderr == 21) { |
|
| 340 | + 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>'; |
|
| 341 | + } else { |
|
| 342 | + echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>'; |
|
| 343 | + } |
|
| 338 | 344 | break; |
| 339 | 345 | } |
| 340 | 346 | } |
@@ -385,8 +391,12 @@ discard block |
||
| 385 | 391 | include_once('option-pages/' . $current_tab . '_array.php');
|
| 386 | 392 | } |
| 387 | 393 | 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'));
|
|
| 394 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) { |
|
| 395 | + die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
|
| 396 | + } |
|
| 397 | + if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) { |
|
| 398 | + die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
|
| 399 | + } |
|
| 390 | 400 | |
| 391 | 401 | /** |
| 392 | 402 | * Fires before updating geodirectory admin settings. |
@@ -398,8 +408,9 @@ discard block |
||
| 398 | 408 | */ |
| 399 | 409 | do_action('geodir_before_update_options', $current_tab, $geodir_settings);
|
| 400 | 410 | |
| 401 | - if (!empty($geodir_settings[$current_tab])) |
|
| 402 | - geodir_update_options($geodir_settings[$current_tab]); |
|
| 411 | + if (!empty($geodir_settings[$current_tab])) { |
|
| 412 | + geodir_update_options($geodir_settings[$current_tab]); |
|
| 413 | + } |
|
| 403 | 414 | |
| 404 | 415 | /** |
| 405 | 416 | * Called after GeoDirectory options settings are updated. |
@@ -447,11 +458,14 @@ discard block |
||
| 447 | 458 | * @return bool Returns true if saved. |
| 448 | 459 | */ |
| 449 | 460 | function geodir_update_options($options, $dummy = false) {
|
| 450 | - if ((!isset($_POST) || !$_POST) && !$dummy) return false; |
|
| 461 | + if ((!isset($_POST) || !$_POST) && !$dummy) { |
|
| 462 | + return false; |
|
| 463 | + } |
|
| 451 | 464 | |
| 452 | 465 | foreach ($options as $value) {
|
| 453 | - if ($dummy && isset($value['std'])) |
|
| 454 | - $_POST[$value['id']] = $value['std']; |
|
| 466 | + if ($dummy && isset($value['std'])) { |
|
| 467 | + $_POST[$value['id']] = $value['std']; |
|
| 468 | + } |
|
| 455 | 469 | |
| 456 | 470 | |
| 457 | 471 | if (isset($value['type']) && $value['type'] == 'checkbox') : |
@@ -460,25 +474,23 @@ discard block |
||
| 460 | 474 | update_option($value['id'], $_POST[$value['id']]); |
| 461 | 475 | } else {
|
| 462 | 476 | update_option($value['id'], 0); |
| 463 | - } |
|
| 464 | - |
|
| 465 | - elseif (isset($value['type']) && $value['type'] == 'image_width') : |
|
| 477 | + } elseif (isset($value['type']) && $value['type'] == 'image_width') : |
|
| 466 | 478 | |
| 467 | 479 | if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) {
|
| 468 | 480 | update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']); |
| 469 | 481 | update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']); |
| 470 | 482 | if (isset($_POST[$value['id'] . '_crop'])) : |
| 471 | 483 | update_option($value['id'] . '_crop', 1); |
| 472 | - else : |
|
| 473 | - update_option($value['id'] . '_crop', 0); |
|
| 484 | + else { |
|
| 485 | + : |
|
| 486 | + update_option($value['id'] . '_crop', 0); |
|
| 487 | + } |
|
| 474 | 488 | endif; |
| 475 | 489 | } else {
|
| 476 | 490 | update_option($value['id'] . '_width', $value['std']); |
| 477 | 491 | update_option($value['id'] . '_height', $value['std']); |
| 478 | 492 | update_option($value['id'] . '_crop', 1); |
| 479 | - } |
|
| 480 | - |
|
| 481 | - elseif (isset($value['type']) && $value['type'] == 'map') : |
|
| 493 | + } elseif (isset($value['type']) && $value['type'] == 'map') : |
|
| 482 | 494 | $post_types = array(); |
| 483 | 495 | $categories = array(); |
| 484 | 496 | |
@@ -523,8 +535,9 @@ discard block |
||
| 523 | 535 | $image_name_arr = explode('/', get_option($value['id']));
|
| 524 | 536 | $noimg_name = end($image_name_arr); |
| 525 | 537 | $img_path = $uploads['path'] . '/' . $noimg_name; |
| 526 | - if (file_exists($img_path)) |
|
| 527 | - unlink($img_path); |
|
| 538 | + if (file_exists($img_path)) { |
|
| 539 | + unlink($img_path); |
|
| 540 | + } |
|
| 528 | 541 | } |
| 529 | 542 | |
| 530 | 543 | update_option($value['id'], ''); |
@@ -540,8 +553,10 @@ discard block |
||
| 540 | 553 | foreach ($uploadedfile as $key => $uplaod): |
| 541 | 554 | if ($key == 'name'): |
| 542 | 555 | $uplaods[$key] = $filename; |
| 543 | - else : |
|
| 544 | - $uplaods[$key] = $uplaod; |
|
| 556 | + else { |
|
| 557 | + : |
|
| 558 | + $uplaods[$key] = $uplaod; |
|
| 559 | + } |
|
| 545 | 560 | endif; |
| 546 | 561 | endforeach; |
| 547 | 562 | |
@@ -551,8 +566,9 @@ discard block |
||
| 551 | 566 | $image_name_arr = explode('/', get_option($value['id']));
|
| 552 | 567 | $noimg_name = end($image_name_arr); |
| 553 | 568 | $img_path = $uploads['path'] . '/' . $noimg_name; |
| 554 | - if (file_exists($img_path)) |
|
| 555 | - unlink($img_path); |
|
| 569 | + if (file_exists($img_path)) { |
|
| 570 | + unlink($img_path); |
|
| 571 | + } |
|
| 556 | 572 | } |
| 557 | 573 | |
| 558 | 574 | $upload_overrides = array('test_form' => false);
|
@@ -567,10 +583,12 @@ discard block |
||
| 567 | 583 | endif; |
| 568 | 584 | |
| 569 | 585 | |
| 570 | - else : |
|
| 586 | + else { |
|
| 587 | + : |
|
| 571 | 588 | // same menu setting per theme. |
| 572 | 589 | if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
|
| 573 | - $theme = wp_get_theme(); |
|
| 590 | + $theme = wp_get_theme(); |
|
| 591 | + } |
|
| 574 | 592 | update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
|
| 575 | 593 | } |
| 576 | 594 | |
@@ -582,8 +600,9 @@ discard block |
||
| 582 | 600 | |
| 583 | 601 | endif; |
| 584 | 602 | } |
| 585 | - if ($dummy) |
|
| 586 | - $_POST = array(); |
|
| 603 | + if ($dummy) { |
|
| 604 | + $_POST = array(); |
|
| 605 | + } |
|
| 587 | 606 | return true; |
| 588 | 607 | |
| 589 | 608 | } |
@@ -729,9 +748,12 @@ discard block |
||
| 729 | 748 | $new_columns = array('location' => __('Location (ID)', 'geodirectory'),
|
| 730 | 749 | 'categorys' => __('Categories', 'geodirectory'));
|
| 731 | 750 | |
| 732 | - if (($offset = array_search('author', array_keys($columns))) === false) // if the key doesn't exist
|
|
| 751 | + if (($offset = array_search('author', array_keys($columns))) === false) { |
|
| 752 | + // if the key doesn't exist |
|
| 733 | 753 | {
|
| 734 | - $offset = 0; // should we prepend $array with $data? |
|
| 754 | + $offset = 0; |
|
| 755 | + } |
|
| 756 | + // should we prepend $array with $data? |
|
| 735 | 757 | $offset = count($columns); // or should we append $array with $data? lets pick this one... |
| 736 | 758 | } |
| 737 | 759 | |
@@ -791,11 +813,13 @@ discard block |
||
| 791 | 813 | $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>';
|
| 792 | 814 | } |
| 793 | 815 | /* If no expire_date is found, output a default message. */ |
| 794 | - if (empty($expire_date)) |
|
| 795 | - echo __('Unknown', 'geodirectory');
|
|
| 816 | + if (empty($expire_date)) { |
|
| 817 | + echo __('Unknown', 'geodirectory'); |
|
| 818 | + } |
|
| 796 | 819 | /* If there is a expire_date, append 'days left' to the text string. */ |
| 797 | - else |
|
| 798 | - echo $expire_date . $date_diff_text; |
|
| 820 | + else { |
|
| 821 | + echo $expire_date . $date_diff_text; |
|
| 822 | + } |
|
| 799 | 823 | break; |
| 800 | 824 | |
| 801 | 825 | /* If displaying the 'categorys' column. */ |
@@ -868,21 +892,26 @@ discard block |
||
| 868 | 892 | |
| 869 | 893 | $geodir_posttypes = geodir_get_posttypes(); |
| 870 | 894 | |
| 871 | - if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
|
|
| 872 | - return; |
|
| 895 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { |
|
| 896 | + return; |
|
| 897 | + } |
|
| 873 | 898 | |
| 874 | 899 | 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']); |
|
| 900 | + if (isset($_REQUEST['_status'])) { |
|
| 901 | + geodir_change_post_status($post_id, $_REQUEST['_status']); |
|
| 902 | + } |
|
| 877 | 903 | |
| 878 | - if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'trash' || $_REQUEST['action'] == 'untrash')) |
|
| 879 | - return; |
|
| 904 | + if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'trash' || $_REQUEST['action'] == 'untrash')) { |
|
| 905 | + return; |
|
| 906 | + } |
|
| 880 | 907 | |
| 881 | - if (!isset($_POST['geodir_post_info_noncename']) || !wp_verify_nonce($_POST['geodir_post_info_noncename'], plugin_basename(__FILE__))) |
|
| 882 | - return; |
|
| 908 | + if (!isset($_POST['geodir_post_info_noncename']) || !wp_verify_nonce($_POST['geodir_post_info_noncename'], plugin_basename(__FILE__))) { |
|
| 909 | + return; |
|
| 910 | + } |
|
| 883 | 911 | |
| 884 | - if (!isset($_POST['geodir_post_attachments_noncename']) || !wp_verify_nonce($_POST['geodir_post_attachments_noncename'], plugin_basename(__FILE__))) |
|
| 885 | - return; |
|
| 912 | + if (!isset($_POST['geodir_post_attachments_noncename']) || !wp_verify_nonce($_POST['geodir_post_attachments_noncename'], plugin_basename(__FILE__))) { |
|
| 913 | + return; |
|
| 914 | + } |
|
| 886 | 915 | |
| 887 | 916 | geodir_save_listing($_REQUEST); |
| 888 | 917 | } |
@@ -907,10 +936,18 @@ discard block |
||
| 907 | 936 | $tab_id = ''; |
| 908 | 937 | $i = 0; |
| 909 | 938 | 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'] = ''; |
|
| 939 | + if (!isset($value['name'])) { |
|
| 940 | + $value['name'] = ''; |
|
| 941 | + } |
|
| 942 | + if (!isset($value['class'])) { |
|
| 943 | + $value['class'] = ''; |
|
| 944 | + } |
|
| 945 | + if (!isset($value['css'])) { |
|
| 946 | + $value['css'] = ''; |
|
| 947 | + } |
|
| 948 | + if (!isset($value['std'])) { |
|
| 949 | + $value['std'] = ''; |
|
| 950 | + } |
|
| 914 | 951 | $desc = ''; |
| 915 | 952 | switch ($value['type']) : |
| 916 | 953 | case 'dummy_installer': |
@@ -926,11 +963,13 @@ discard block |
||
| 926 | 963 | |
| 927 | 964 | $i++; |
| 928 | 965 | |
| 929 | - if (isset($value['id']) && $value['id']) |
|
| 930 | - $tab_id = $value['id']; |
|
| 966 | + if (isset($value['id']) && $value['id']) { |
|
| 967 | + $tab_id = $value['id']; |
|
| 968 | + } |
|
| 931 | 969 | |
| 932 | - if (isset($value['desc']) && $value['desc']) |
|
| 933 | - $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
| 970 | + if (isset($value['desc']) && $value['desc']) { |
|
| 971 | + $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
| 972 | + } |
|
| 934 | 973 | |
| 935 | 974 | if (isset($value['name']) && $value['name']) {
|
| 936 | 975 | if ($first_title === true) {
|
@@ -961,10 +1000,12 @@ discard block |
||
| 961 | 1000 | break; |
| 962 | 1001 | |
| 963 | 1002 | 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>'; |
|
| 1003 | + if (isset($value['desc']) && $value['desc']) { |
|
| 1004 | + $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>'; |
|
| 1005 | + } |
|
| 1006 | + if (isset($value['name']) && $value['name']) { |
|
| 1007 | + echo '<h3>' . $value['name'] . $desc . '</h3>'; |
|
| 1008 | + } |
|
| 968 | 1009 | /** |
| 969 | 1010 | * Called after a GeoDirectory settings sectionstart is output in the GD settings page. |
| 970 | 1011 | * |
@@ -972,7 +1013,9 @@ discard block |
||
| 972 | 1013 | * |
| 973 | 1014 | * @since 1.0.0 |
| 974 | 1015 | */ |
| 975 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start');
|
|
| 1016 | + if (isset($value['id']) && $value['id']) { |
|
| 1017 | + do_action('geodir_settings_' . sanitize_title($value['id']) . '_start'); |
|
| 1018 | + } |
|
| 976 | 1019 | echo '<table class="form-table">' . "\n\n"; |
| 977 | 1020 | |
| 978 | 1021 | break; |
@@ -984,7 +1027,9 @@ discard block |
||
| 984 | 1027 | * |
| 985 | 1028 | * @since 1.0.0 |
| 986 | 1029 | */ |
| 987 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
|
|
| 1030 | + if (isset($value['id']) && $value['id']) { |
|
| 1031 | + do_action('geodir_settings_' . sanitize_title($value['id']) . '_end'); |
|
| 1032 | + } |
|
| 988 | 1033 | echo '</table>'; |
| 989 | 1034 | /** |
| 990 | 1035 | * Called after a GeoDirectory settings sectionend is output in the GD settings page. |
@@ -993,7 +1038,9 @@ discard block |
||
| 993 | 1038 | * |
| 994 | 1039 | * @since 1.0.0 |
| 995 | 1040 | */ |
| 996 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
|
|
| 1041 | + if (isset($value['id']) && $value['id']) { |
|
| 1042 | + do_action('geodir_settings_' . sanitize_title($value['id']) . '_after'); |
|
| 1043 | + } |
|
| 997 | 1044 | break; |
| 998 | 1045 | case 'text': |
| 999 | 1046 | ?> |
@@ -1065,17 +1112,32 @@ discard block |
||
| 1065 | 1112 | <?php _e('Width', 'geodirectory'); ?> <input
|
| 1066 | 1113 | name="<?php echo esc_attr($value['id']); ?>_width" |
| 1067 | 1114 | id="<?php echo esc_attr($value['id']); ?>_width" type="text" size="3" |
| 1068 | - value="<?php if ($size = get_option($value['id'] . '_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
| 1115 | + value="<?php if ($size = get_option($value['id'] . '_width')) { |
|
| 1116 | + echo stripslashes($size); |
|
| 1117 | +} else { |
|
| 1118 | + echo $value['std']; |
|
| 1119 | +} |
|
| 1120 | +?>"/> |
|
| 1069 | 1121 | |
| 1070 | 1122 | <?php _e('Height', 'geodirectory'); ?> <input
|
| 1071 | 1123 | name="<?php echo esc_attr($value['id']); ?>_height" |
| 1072 | 1124 | id="<?php echo esc_attr($value['id']); ?>_height" type="text" size="3" |
| 1073 | - value="<?php if ($size = get_option($value['id'] . '_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
| 1125 | + value="<?php if ($size = get_option($value['id'] . '_height')) { |
|
| 1126 | + echo stripslashes($size); |
|
| 1127 | +} else { |
|
| 1128 | + echo $value['std']; |
|
| 1129 | +} |
|
| 1130 | +?>"/> |
|
| 1074 | 1131 | |
| 1075 | 1132 | <label><?php _e('Hard Crop', 'geodirectory'); ?> <input
|
| 1076 | 1133 | name="<?php echo esc_attr($value['id']); ?>_crop" |
| 1077 | 1134 | id="<?php echo esc_attr($value['id']); ?>_crop" |
| 1078 | - type="checkbox" <?php if (get_option($value['id'] . '_crop') != '') checked(get_option($value['id'] . '_crop'), 1); else checked(1); ?> /></label> |
|
| 1135 | + type="checkbox" <?php if (get_option($value['id'] . '_crop') != '') { |
|
| 1136 | + checked(get_option($value['id'] . '_crop'), 1); |
|
| 1137 | +} else { |
|
| 1138 | + checked(1); |
|
| 1139 | +} |
|
| 1140 | +?> /></label> |
|
| 1079 | 1141 | |
| 1080 | 1142 | <span class="description"><?php echo $value['desc'] ?></span></td> |
| 1081 | 1143 | </tr><?php |
@@ -1089,17 +1151,22 @@ discard block |
||
| 1089 | 1151 | <td class="forminp"><select name="<?php echo esc_attr($value['id']); ?>" |
| 1090 | 1152 | id="<?php echo esc_attr($value['id']); ?>" |
| 1091 | 1153 | style="<?php echo esc_attr($value['css']); ?>" |
| 1092 | - class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
|
| 1154 | + class="<?php if (isset($value['class'])) { |
|
| 1155 | + echo $value['class']; |
|
| 1156 | +} |
|
| 1157 | +?>" |
|
| 1093 | 1158 | option-ajaxchosen="false"> |
| 1094 | 1159 | <?php |
| 1095 | 1160 | foreach ($value['options'] as $key => $val) {
|
| 1096 | 1161 | $geodir_select_value = ''; |
| 1097 | 1162 | if ($option_value != '') {
|
| 1098 | - if ($option_value != '' && $option_value == $key) |
|
| 1099 | - $geodir_select_value = ' selected="selected" '; |
|
| 1163 | + if ($option_value != '' && $option_value == $key) { |
|
| 1164 | + $geodir_select_value = ' selected="selected" '; |
|
| 1165 | + } |
|
| 1100 | 1166 | } else {
|
| 1101 | - if ($value['std'] == $key) |
|
| 1102 | - $geodir_select_value = ' selected="selected" '; |
|
| 1167 | + if ($value['std'] == $key) { |
|
| 1168 | + $geodir_select_value = ' selected="selected" '; |
|
| 1169 | + } |
|
| 1103 | 1170 | } |
| 1104 | 1171 | ?> |
| 1105 | 1172 | <option |
@@ -1124,8 +1191,14 @@ discard block |
||
| 1124 | 1191 | <td class="forminp"><select multiple="multiple" name="<?php echo esc_attr($value['id']); ?>[]" |
| 1125 | 1192 | id="<?php echo esc_attr($value['id']); ?>" |
| 1126 | 1193 | style="<?php echo esc_attr($value['css']); ?>" |
| 1127 | - class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
|
| 1128 | - data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>" |
|
| 1194 | + class="<?php if (isset($value['class'])) { |
|
| 1195 | + echo $value['class']; |
|
| 1196 | +} |
|
| 1197 | +?>" |
|
| 1198 | + data-placeholder="<?php if (isset($value['placeholder_text'])) { |
|
| 1199 | + echo $value['placeholder_text']; |
|
| 1200 | +} |
|
| 1201 | +?>" |
|
| 1129 | 1202 | option-ajaxchosen="false"> |
| 1130 | 1203 | <?php |
| 1131 | 1204 | foreach ($value['options'] as $key => $val) {
|
@@ -1152,7 +1225,10 @@ discard block |
||
| 1152 | 1225 | <td class="forminp"> |
| 1153 | 1226 | <input type="file" name="<?php echo esc_attr($value['id']); ?>" |
| 1154 | 1227 | id="<?php echo esc_attr($value['id']); ?>" style="<?php echo esc_attr($value['css']); ?>" |
| 1155 | - class="<?php if (isset($value['class'])) echo $value['class']; ?>"/> |
|
| 1228 | + class="<?php if (isset($value['class'])) { |
|
| 1229 | + echo $value['class']; |
|
| 1230 | +} |
|
| 1231 | +?>"/> |
|
| 1156 | 1232 | <?php if (get_option($value['id'])) { ?>
|
| 1157 | 1233 | <input type="hidden" name="<?php echo esc_attr($value['id']); ?>_remove" |
| 1158 | 1234 | id="<?php echo esc_attr($value['id']); ?>_remove" value="0"> |
@@ -1233,13 +1309,15 @@ discard block |
||
| 1233 | 1309 | 'zh-TW' => __('CHINESE (TRADITIONAL)', 'geodirectory'),
|
| 1234 | 1310 | ); |
| 1235 | 1311 | $geodir_default_map_language = get_option('geodir_default_map_language');
|
| 1236 | - if (empty($geodir_default_map_language)) |
|
| 1237 | - $geodir_default_map_language = 'en'; |
|
| 1312 | + if (empty($geodir_default_map_language)) { |
|
| 1313 | + $geodir_default_map_language = 'en'; |
|
| 1314 | + } |
|
| 1238 | 1315 | 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 = ''; |
|
| 1316 | + if (!empty($geodir_default_map_language) && $language_key == $geodir_default_map_language) { |
|
| 1317 | + $geodir_default_language_selected = "selected='selected'"; |
|
| 1318 | + } else { |
|
| 1319 | + $geodir_default_language_selected = ''; |
|
| 1320 | + } |
|
| 1243 | 1321 | |
| 1244 | 1322 | ?> |
| 1245 | 1323 | <option |
@@ -1259,14 +1337,16 @@ discard block |
||
| 1259 | 1337 | <?php |
| 1260 | 1338 | $post_types = geodir_get_posttypes('array');
|
| 1261 | 1339 | $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'; |
|
| 1340 | + if (empty($geodir_default_map_search_pt)) { |
|
| 1341 | + $geodir_default_map_search_pt = 'gd_place'; |
|
| 1342 | + } |
|
| 1264 | 1343 | if (is_array($post_types)) {
|
| 1265 | 1344 | 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 = ''; |
|
| 1345 | + if (!empty($geodir_default_map_search_pt) && $key == $geodir_default_map_search_pt) { |
|
| 1346 | + $geodir_search_pt_selected = "selected='selected'"; |
|
| 1347 | + } else { |
|
| 1348 | + $geodir_search_pt_selected = ''; |
|
| 1349 | + } |
|
| 1270 | 1350 | |
| 1271 | 1351 | ?> |
| 1272 | 1352 | <option |
@@ -1386,7 +1466,7 @@ discard block |
||
| 1386 | 1466 | id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio" |
| 1387 | 1467 | value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) {
|
| 1388 | 1468 | echo 'checked="checked"'; |
| 1389 | - }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
|
|
| 1469 | + } elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
|
|
| 1390 | 1470 | <?php echo $value['desc']; ?></label><br> |
| 1391 | 1471 | </fieldset> |
| 1392 | 1472 | <?php |
@@ -1406,10 +1486,18 @@ discard block |
||
| 1406 | 1486 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1407 | 1487 | <td class="forminp"> |
| 1408 | 1488 | <textarea |
| 1409 | - <?php if (isset($value['args'])) echo $value['args'] . ' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
| 1489 | + <?php if (isset($value['args'])) { |
|
| 1490 | + echo $value['args'] . ' '; |
|
| 1491 | +} |
|
| 1492 | +?>name="<?php echo esc_attr($value['id']); ?>" |
|
| 1410 | 1493 | id="<?php echo esc_attr($value['id']); ?>" |
| 1411 | 1494 | <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
| 1412 | - style="<?php echo esc_attr($value['css']); ?>"><?php if (get_option($value['id'])) echo esc_textarea(stripslashes(get_option($value['id']))); else echo esc_textarea($value['std']); ?></textarea><span |
|
| 1495 | + style="<?php echo esc_attr($value['css']); ?>"><?php if (get_option($value['id'])) { |
|
| 1496 | + echo esc_textarea(stripslashes(get_option($value['id']))); |
|
| 1497 | +} else { |
|
| 1498 | + echo esc_textarea($value['std']); |
|
| 1499 | +} |
|
| 1500 | +?></textarea><span |
|
| 1413 | 1501 | class="description"><?php echo $value['desc'] ?></span> |
| 1414 | 1502 | |
| 1415 | 1503 | </td> |
@@ -1421,10 +1509,11 @@ discard block |
||
| 1421 | 1509 | <tr valign="top"> |
| 1422 | 1510 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
| 1423 | 1511 | <td class="forminp"><?php |
| 1424 | - if (get_option($value['id'])) |
|
| 1425 | - $content = stripslashes(get_option($value['id'])); |
|
| 1426 | - else |
|
| 1427 | - $content = $value['std']; |
|
| 1512 | + if (get_option($value['id'])) { |
|
| 1513 | + $content = stripslashes(get_option($value['id'])); |
|
| 1514 | + } else { |
|
| 1515 | + $content = $value['std']; |
|
| 1516 | + } |
|
| 1428 | 1517 | |
| 1429 | 1518 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
| 1430 | 1519 | |
@@ -1464,7 +1553,9 @@ discard block |
||
| 1464 | 1553 | 'echo' => false, |
| 1465 | 1554 | 'selected' => $page_setting); |
| 1466 | 1555 | |
| 1467 | - if (isset($value['args'])) $args = wp_parse_args($value['args'], $args); |
|
| 1556 | + if (isset($value['args'])) { |
|
| 1557 | + $args = wp_parse_args($value['args'], $args); |
|
| 1558 | + } |
|
| 1468 | 1559 | |
| 1469 | 1560 | ?> |
| 1470 | 1561 | <tr valign="top" class="single_select_page"> |
@@ -1483,8 +1574,10 @@ discard block |
||
| 1483 | 1574 | if (strstr($country_setting, ':')) : |
| 1484 | 1575 | $country = current(explode(':', $country_setting));
|
| 1485 | 1576 | $state = end(explode(':', $country_setting));
|
| 1486 | - else : |
|
| 1487 | - $country = $country_setting; |
|
| 1577 | + else { |
|
| 1578 | + : |
|
| 1579 | + $country = $country_setting; |
|
| 1580 | + } |
|
| 1488 | 1581 | $state = '*'; |
| 1489 | 1582 | endif; |
| 1490 | 1583 | ?> |
@@ -1511,8 +1604,10 @@ discard block |
||
| 1511 | 1604 | data-placeholder="<?php _e('Choose countries…', 'geodirectory'); ?>"
|
| 1512 | 1605 | title="Country" class="chosen_select"> |
| 1513 | 1606 | <?php |
| 1514 | - if ($countries) foreach ($countries as $key => $val) : |
|
| 1515 | - echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
| 1607 | + if ($countries) { |
|
| 1608 | + foreach ($countries as $key => $val) : |
|
| 1609 | + echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
| 1610 | + } |
|
| 1516 | 1611 | endforeach; |
| 1517 | 1612 | ?> |
| 1518 | 1613 | </select> |
@@ -1747,8 +1842,9 @@ discard block |
||
| 1747 | 1842 | endforeach; |
| 1748 | 1843 | endif; |
| 1749 | 1844 | |
| 1750 | - if (!empty($place_img_array)) |
|
| 1751 | - $curImages = implode(',', $place_img_array);
|
|
| 1845 | + if (!empty($place_img_array)) { |
|
| 1846 | + $curImages = implode(',', $place_img_array); |
|
| 1847 | + } |
|
| 1752 | 1848 | |
| 1753 | 1849 | |
| 1754 | 1850 | // adjust values here |
@@ -2094,16 +2190,17 @@ discard block |
||
| 2094 | 2190 | global $post, $typenow, $current_screen; |
| 2095 | 2191 | |
| 2096 | 2192 | $post_type = NULL; |
| 2097 | - if (isset($_REQUEST['post']) && get_post_type($_REQUEST['post'])) |
|
| 2098 | - $post_type = get_post_type($_REQUEST['post']); |
|
| 2099 | - elseif ($post && isset($post->post_type)) |
|
| 2100 | - $post_type = $post->post_type; |
|
| 2101 | - elseif ($typenow) |
|
| 2102 | - $post_type = $typenow; |
|
| 2103 | - elseif ($current_screen && isset($current_screen->post_type)) |
|
| 2104 | - $post_type = $current_screen->post_type; |
|
| 2105 | - elseif (isset($_REQUEST['post_type'])) |
|
| 2106 | - $post_type = sanitize_key($_REQUEST['post_type']); |
|
| 2193 | + if (isset($_REQUEST['post']) && get_post_type($_REQUEST['post'])) { |
|
| 2194 | + $post_type = get_post_type($_REQUEST['post']); |
|
| 2195 | + } elseif ($post && isset($post->post_type)) { |
|
| 2196 | + $post_type = $post->post_type; |
|
| 2197 | + } elseif ($typenow) { |
|
| 2198 | + $post_type = $typenow; |
|
| 2199 | + } elseif ($current_screen && isset($current_screen->post_type)) { |
|
| 2200 | + $post_type = $current_screen->post_type; |
|
| 2201 | + } elseif (isset($_REQUEST['post_type'])) { |
|
| 2202 | + $post_type = sanitize_key($_REQUEST['post_type']); |
|
| 2203 | + } |
|
| 2107 | 2204 | |
| 2108 | 2205 | |
| 2109 | 2206 | return $post_type; |
@@ -2163,9 +2260,10 @@ discard block |
||
| 2163 | 2260 | function geodir_hide_admin_preview_button() {
|
| 2164 | 2261 | global $post_type; |
| 2165 | 2262 | $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 | -} |
|
| 2263 | + if(in_array($post_type, $post_types)) { |
|
| 2264 | + echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>'; |
|
| 2265 | + } |
|
| 2266 | + } |
|
| 2169 | 2267 | add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' ); |
| 2170 | 2268 | add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' ); |
| 2171 | 2269 | |
@@ -5367,8 +5465,9 @@ discard block |
||
| 5367 | 5465 | function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) {
|
| 5368 | 5466 | global $wpdb, $plugin_prefix; |
| 5369 | 5467 | |
| 5370 | - if ( ! post_type_exists( $post_type ) ) |
|
| 5371 | - return new stdClass; |
|
| 5468 | + if ( ! post_type_exists( $post_type ) ) { |
|
| 5469 | + return new stdClass; |
|
| 5470 | + } |
|
| 5372 | 5471 | |
| 5373 | 5472 | $table = $plugin_prefix . $post_type . '_detail'; |
| 5374 | 5473 | |
@@ -6203,7 +6302,9 @@ discard block |
||
| 6203 | 6302 | |
| 6204 | 6303 | if ($page_found) : |
| 6205 | 6304 | // Page exists |
| 6206 | - if (!$option_value) update_option($option, $page_found); |
|
| 6305 | + if (!$option_value) { |
|
| 6306 | + update_option($option, $page_found); |
|
| 6307 | + } |
|
| 6207 | 6308 | return; |
| 6208 | 6309 | endif; |
| 6209 | 6310 | |
@@ -6578,7 +6679,7 @@ discard block |
||
| 6578 | 6679 | $accounts = geodir_ga_get_analytics_accounts(); |
| 6579 | 6680 | if(is_array($accounts)){
|
| 6580 | 6681 | $accounts = array_merge(array(__('Select Account','geodirectory')),$accounts);
|
| 6581 | - }elseif(get_option('geodir_ga_account_id')){
|
|
| 6682 | + } elseif(get_option('geodir_ga_account_id')){
|
|
| 6582 | 6683 | $accounts = array(); |
| 6583 | 6684 | $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required','geodirectory').' ('.get_option('geodir_ga_account_id').')';
|
| 6584 | 6685 | } |
@@ -6599,14 +6700,16 @@ discard block |
||
| 6599 | 6700 | |
| 6600 | 6701 | |
| 6601 | 6702 | # Create a new Gdata call |
| 6602 | - if ( trim(get_option('geodir_ga_auth_code')) != '' )
|
|
| 6603 | - $stats = new GDGoogleAnalyticsStats(); |
|
| 6604 | - else |
|
| 6605 | - return false; |
|
| 6703 | + if ( trim(get_option('geodir_ga_auth_code')) != '' ) { |
|
| 6704 | + $stats = new GDGoogleAnalyticsStats(); |
|
| 6705 | + } else { |
|
| 6706 | + return false; |
|
| 6707 | + } |
|
| 6606 | 6708 | |
| 6607 | 6709 | # Check if Google sucessfully logged in |
| 6608 | - if ( ! $stats->checkLogin() ) |
|
| 6609 | - return false; |
|
| 6710 | + if ( ! $stats->checkLogin() ) { |
|
| 6711 | + return false; |
|
| 6712 | + } |
|
| 6610 | 6713 | |
| 6611 | 6714 | # Get a list of accounts |
| 6612 | 6715 | $accounts = $stats->getAllProfiles(); |
@@ -6617,8 +6720,8 @@ discard block |
||
| 6617 | 6720 | if ( count($accounts) > 0 ){
|
| 6618 | 6721 | update_option('geodir_gd_uids',$accounts);
|
| 6619 | 6722 | return $accounts; |
| 6723 | + } else { |
|
| 6724 | + return false; |
|
| 6725 | + } |
|
| 6620 | 6726 | } |
| 6621 | - else |
|
| 6622 | - return false; |
|
| 6623 | -} |
|
| 6624 | 6727 | |
@@ -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 | } |
@@ -1266,25 +1266,25 @@ discard block |
||
| 1266 | 1266 | public function getChildLink() { |
| 1267 | 1267 | return $this->childLink; |
| 1268 | 1268 | } |
| 1269 | - public function setCreated( $created) { |
|
| 1269 | + public function setCreated($created) { |
|
| 1270 | 1270 | $this->created = $created; |
| 1271 | 1271 | } |
| 1272 | 1272 | public function getCreated() { |
| 1273 | 1273 | return $this->created; |
| 1274 | 1274 | } |
| 1275 | - public function setId( $id) { |
|
| 1275 | + public function setId($id) { |
|
| 1276 | 1276 | $this->id = $id; |
| 1277 | 1277 | } |
| 1278 | 1278 | public function getId() { |
| 1279 | 1279 | return $this->id; |
| 1280 | 1280 | } |
| 1281 | - public function setKind( $kind) { |
|
| 1281 | + public function setKind($kind) { |
|
| 1282 | 1282 | $this->kind = $kind; |
| 1283 | 1283 | } |
| 1284 | 1284 | public function getKind() { |
| 1285 | 1285 | return $this->kind; |
| 1286 | 1286 | } |
| 1287 | - public function setName( $name) { |
|
| 1287 | + public function setName($name) { |
|
| 1288 | 1288 | $this->name = $name; |
| 1289 | 1289 | } |
| 1290 | 1290 | public function getName() { |
@@ -1296,13 +1296,13 @@ discard block |
||
| 1296 | 1296 | public function getPermissions() { |
| 1297 | 1297 | return $this->permissions; |
| 1298 | 1298 | } |
| 1299 | - public function setSelfLink( $selfLink) { |
|
| 1299 | + public function setSelfLink($selfLink) { |
|
| 1300 | 1300 | $this->selfLink = $selfLink; |
| 1301 | 1301 | } |
| 1302 | 1302 | public function getSelfLink() { |
| 1303 | 1303 | return $this->selfLink; |
| 1304 | 1304 | } |
| 1305 | - public function setUpdated( $updated) { |
|
| 1305 | + public function setUpdated($updated) { |
|
| 1306 | 1306 | $this->updated = $updated; |
| 1307 | 1307 | } |
| 1308 | 1308 | public function getUpdated() { |
@@ -1313,13 +1313,13 @@ discard block |
||
| 1313 | 1313 | class Google_AccountChildLink extends Google_Model { |
| 1314 | 1314 | public $href; |
| 1315 | 1315 | public $type; |
| 1316 | - public function setHref( $href) { |
|
| 1316 | + public function setHref($href) { |
|
| 1317 | 1317 | $this->href = $href; |
| 1318 | 1318 | } |
| 1319 | 1319 | public function getHref() { |
| 1320 | 1320 | return $this->href; |
| 1321 | 1321 | } |
| 1322 | - public function setType( $type) { |
|
| 1322 | + public function setType($type) { |
|
| 1323 | 1323 | $this->type = $type; |
| 1324 | 1324 | } |
| 1325 | 1325 | public function getType() { |
@@ -1343,25 +1343,25 @@ discard block |
||
| 1343 | 1343 | public $id; |
| 1344 | 1344 | public $kind; |
| 1345 | 1345 | public $name; |
| 1346 | - public function setHref( $href) { |
|
| 1346 | + public function setHref($href) { |
|
| 1347 | 1347 | $this->href = $href; |
| 1348 | 1348 | } |
| 1349 | 1349 | public function getHref() { |
| 1350 | 1350 | return $this->href; |
| 1351 | 1351 | } |
| 1352 | - public function setId( $id) { |
|
| 1352 | + public function setId($id) { |
|
| 1353 | 1353 | $this->id = $id; |
| 1354 | 1354 | } |
| 1355 | 1355 | public function getId() { |
| 1356 | 1356 | return $this->id; |
| 1357 | 1357 | } |
| 1358 | - public function setKind( $kind) { |
|
| 1358 | + public function setKind($kind) { |
|
| 1359 | 1359 | $this->kind = $kind; |
| 1360 | 1360 | } |
| 1361 | 1361 | public function getKind() { |
| 1362 | 1362 | return $this->kind; |
| 1363 | 1363 | } |
| 1364 | - public function setName( $name) { |
|
| 1364 | + public function setName($name) { |
|
| 1365 | 1365 | $this->name = $name; |
| 1366 | 1366 | } |
| 1367 | 1367 | public function getName() { |
@@ -1387,43 +1387,43 @@ discard block |
||
| 1387 | 1387 | public function getItems() { |
| 1388 | 1388 | return $this->items; |
| 1389 | 1389 | } |
| 1390 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 1390 | + public function setItemsPerPage($itemsPerPage) { |
|
| 1391 | 1391 | $this->itemsPerPage = $itemsPerPage; |
| 1392 | 1392 | } |
| 1393 | 1393 | public function getItemsPerPage() { |
| 1394 | 1394 | return $this->itemsPerPage; |
| 1395 | 1395 | } |
| 1396 | - public function setKind( $kind) { |
|
| 1396 | + public function setKind($kind) { |
|
| 1397 | 1397 | $this->kind = $kind; |
| 1398 | 1398 | } |
| 1399 | 1399 | public function getKind() { |
| 1400 | 1400 | return $this->kind; |
| 1401 | 1401 | } |
| 1402 | - public function setNextLink( $nextLink) { |
|
| 1402 | + public function setNextLink($nextLink) { |
|
| 1403 | 1403 | $this->nextLink = $nextLink; |
| 1404 | 1404 | } |
| 1405 | 1405 | public function getNextLink() { |
| 1406 | 1406 | return $this->nextLink; |
| 1407 | 1407 | } |
| 1408 | - public function setPreviousLink( $previousLink) { |
|
| 1408 | + public function setPreviousLink($previousLink) { |
|
| 1409 | 1409 | $this->previousLink = $previousLink; |
| 1410 | 1410 | } |
| 1411 | 1411 | public function getPreviousLink() { |
| 1412 | 1412 | return $this->previousLink; |
| 1413 | 1413 | } |
| 1414 | - public function setStartIndex( $startIndex) { |
|
| 1414 | + public function setStartIndex($startIndex) { |
|
| 1415 | 1415 | $this->startIndex = $startIndex; |
| 1416 | 1416 | } |
| 1417 | 1417 | public function getStartIndex() { |
| 1418 | 1418 | return $this->startIndex; |
| 1419 | 1419 | } |
| 1420 | - public function setTotalResults( $totalResults) { |
|
| 1420 | + public function setTotalResults($totalResults) { |
|
| 1421 | 1421 | $this->totalResults = $totalResults; |
| 1422 | 1422 | } |
| 1423 | 1423 | public function getTotalResults() { |
| 1424 | 1424 | return $this->totalResults; |
| 1425 | 1425 | } |
| 1426 | - public function setUsername( $username) { |
|
| 1426 | + public function setUsername($username) { |
|
| 1427 | 1427 | $this->username = $username; |
| 1428 | 1428 | } |
| 1429 | 1429 | public function getUsername() { |
@@ -1446,19 +1446,19 @@ discard block |
||
| 1446 | 1446 | public $attributes; |
| 1447 | 1447 | public $id; |
| 1448 | 1448 | public $kind; |
| 1449 | - public function setAttributes( $attributes) { |
|
| 1449 | + public function setAttributes($attributes) { |
|
| 1450 | 1450 | $this->attributes = $attributes; |
| 1451 | 1451 | } |
| 1452 | 1452 | public function getAttributes() { |
| 1453 | 1453 | return $this->attributes; |
| 1454 | 1454 | } |
| 1455 | - public function setId( $id) { |
|
| 1455 | + public function setId($id) { |
|
| 1456 | 1456 | $this->id = $id; |
| 1457 | 1457 | } |
| 1458 | 1458 | public function getId() { |
| 1459 | 1459 | return $this->id; |
| 1460 | 1460 | } |
| 1461 | - public function setKind( $kind) { |
|
| 1461 | + public function setKind($kind) { |
|
| 1462 | 1462 | $this->kind = $kind; |
| 1463 | 1463 | } |
| 1464 | 1464 | public function getKind() { |
@@ -1481,7 +1481,7 @@ discard block |
||
| 1481 | 1481 | public function getAttributeNames() { |
| 1482 | 1482 | return $this->attributeNames; |
| 1483 | 1483 | } |
| 1484 | - public function setEtag( $etag) { |
|
| 1484 | + public function setEtag($etag) { |
|
| 1485 | 1485 | $this->etag = $etag; |
| 1486 | 1486 | } |
| 1487 | 1487 | public function getEtag() { |
@@ -1494,13 +1494,13 @@ discard block |
||
| 1494 | 1494 | public function getItems() { |
| 1495 | 1495 | return $this->items; |
| 1496 | 1496 | } |
| 1497 | - public function setKind( $kind) { |
|
| 1497 | + public function setKind($kind) { |
|
| 1498 | 1498 | $this->kind = $kind; |
| 1499 | 1499 | } |
| 1500 | 1500 | public function getKind() { |
| 1501 | 1501 | return $this->kind; |
| 1502 | 1502 | } |
| 1503 | - public function setTotalResults( $totalResults) { |
|
| 1503 | + public function setTotalResults($totalResults) { |
|
| 1504 | 1504 | $this->totalResults = $totalResults; |
| 1505 | 1505 | } |
| 1506 | 1506 | public function getTotalResults() { |
@@ -1526,7 +1526,7 @@ discard block |
||
| 1526 | 1526 | public $type; |
| 1527 | 1527 | public $updated; |
| 1528 | 1528 | public $webPropertyId; |
| 1529 | - public function setAccountId( $accountId) { |
|
| 1529 | + public function setAccountId($accountId) { |
|
| 1530 | 1530 | $this->accountId = $accountId; |
| 1531 | 1531 | } |
| 1532 | 1532 | public function getAccountId() { |
@@ -1538,31 +1538,31 @@ discard block |
||
| 1538 | 1538 | public function getChildLink() { |
| 1539 | 1539 | return $this->childLink; |
| 1540 | 1540 | } |
| 1541 | - public function setCreated( $created) { |
|
| 1541 | + public function setCreated($created) { |
|
| 1542 | 1542 | $this->created = $created; |
| 1543 | 1543 | } |
| 1544 | 1544 | public function getCreated() { |
| 1545 | 1545 | return $this->created; |
| 1546 | 1546 | } |
| 1547 | - public function setDescription( $description) { |
|
| 1547 | + public function setDescription($description) { |
|
| 1548 | 1548 | $this->description = $description; |
| 1549 | 1549 | } |
| 1550 | 1550 | public function getDescription() { |
| 1551 | 1551 | return $this->description; |
| 1552 | 1552 | } |
| 1553 | - public function setId( $id) { |
|
| 1553 | + public function setId($id) { |
|
| 1554 | 1554 | $this->id = $id; |
| 1555 | 1555 | } |
| 1556 | 1556 | public function getId() { |
| 1557 | 1557 | return $this->id; |
| 1558 | 1558 | } |
| 1559 | - public function setKind( $kind) { |
|
| 1559 | + public function setKind($kind) { |
|
| 1560 | 1560 | $this->kind = $kind; |
| 1561 | 1561 | } |
| 1562 | 1562 | public function getKind() { |
| 1563 | 1563 | return $this->kind; |
| 1564 | 1564 | } |
| 1565 | - public function setName( $name) { |
|
| 1565 | + public function setName($name) { |
|
| 1566 | 1566 | $this->name = $name; |
| 1567 | 1567 | } |
| 1568 | 1568 | public function getName() { |
@@ -1581,25 +1581,25 @@ discard block |
||
| 1581 | 1581 | public function getProfilesLinked() { |
| 1582 | 1582 | return $this->profilesLinked; |
| 1583 | 1583 | } |
| 1584 | - public function setSelfLink( $selfLink) { |
|
| 1584 | + public function setSelfLink($selfLink) { |
|
| 1585 | 1585 | $this->selfLink = $selfLink; |
| 1586 | 1586 | } |
| 1587 | 1587 | public function getSelfLink() { |
| 1588 | 1588 | return $this->selfLink; |
| 1589 | 1589 | } |
| 1590 | - public function setType( $type) { |
|
| 1590 | + public function setType($type) { |
|
| 1591 | 1591 | $this->type = $type; |
| 1592 | 1592 | } |
| 1593 | 1593 | public function getType() { |
| 1594 | 1594 | return $this->type; |
| 1595 | 1595 | } |
| 1596 | - public function setUpdated( $updated) { |
|
| 1596 | + public function setUpdated($updated) { |
|
| 1597 | 1597 | $this->updated = $updated; |
| 1598 | 1598 | } |
| 1599 | 1599 | public function getUpdated() { |
| 1600 | 1600 | return $this->updated; |
| 1601 | 1601 | } |
| 1602 | - public function setWebPropertyId( $webPropertyId) { |
|
| 1602 | + public function setWebPropertyId($webPropertyId) { |
|
| 1603 | 1603 | $this->webPropertyId = $webPropertyId; |
| 1604 | 1604 | } |
| 1605 | 1605 | public function getWebPropertyId() { |
@@ -1610,13 +1610,13 @@ discard block |
||
| 1610 | 1610 | class Google_CustomDataSourceChildLink extends Google_Model { |
| 1611 | 1611 | public $href; |
| 1612 | 1612 | public $type; |
| 1613 | - public function setHref( $href) { |
|
| 1613 | + public function setHref($href) { |
|
| 1614 | 1614 | $this->href = $href; |
| 1615 | 1615 | } |
| 1616 | 1616 | public function getHref() { |
| 1617 | 1617 | return $this->href; |
| 1618 | 1618 | } |
| 1619 | - public function setType( $type) { |
|
| 1619 | + public function setType($type) { |
|
| 1620 | 1620 | $this->type = $type; |
| 1621 | 1621 | } |
| 1622 | 1622 | public function getType() { |
@@ -1627,13 +1627,13 @@ discard block |
||
| 1627 | 1627 | class Google_CustomDataSourceParentLink extends Google_Model { |
| 1628 | 1628 | public $href; |
| 1629 | 1629 | public $type; |
| 1630 | - public function setHref( $href) { |
|
| 1630 | + public function setHref($href) { |
|
| 1631 | 1631 | $this->href = $href; |
| 1632 | 1632 | } |
| 1633 | 1633 | public function getHref() { |
| 1634 | 1634 | return $this->href; |
| 1635 | 1635 | } |
| 1636 | - public function setType( $type) { |
|
| 1636 | + public function setType($type) { |
|
| 1637 | 1637 | $this->type = $type; |
| 1638 | 1638 | } |
| 1639 | 1639 | public function getType() { |
@@ -1659,43 +1659,43 @@ discard block |
||
| 1659 | 1659 | public function getItems() { |
| 1660 | 1660 | return $this->items; |
| 1661 | 1661 | } |
| 1662 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 1662 | + public function setItemsPerPage($itemsPerPage) { |
|
| 1663 | 1663 | $this->itemsPerPage = $itemsPerPage; |
| 1664 | 1664 | } |
| 1665 | 1665 | public function getItemsPerPage() { |
| 1666 | 1666 | return $this->itemsPerPage; |
| 1667 | 1667 | } |
| 1668 | - public function setKind( $kind) { |
|
| 1668 | + public function setKind($kind) { |
|
| 1669 | 1669 | $this->kind = $kind; |
| 1670 | 1670 | } |
| 1671 | 1671 | public function getKind() { |
| 1672 | 1672 | return $this->kind; |
| 1673 | 1673 | } |
| 1674 | - public function setNextLink( $nextLink) { |
|
| 1674 | + public function setNextLink($nextLink) { |
|
| 1675 | 1675 | $this->nextLink = $nextLink; |
| 1676 | 1676 | } |
| 1677 | 1677 | public function getNextLink() { |
| 1678 | 1678 | return $this->nextLink; |
| 1679 | 1679 | } |
| 1680 | - public function setPreviousLink( $previousLink) { |
|
| 1680 | + public function setPreviousLink($previousLink) { |
|
| 1681 | 1681 | $this->previousLink = $previousLink; |
| 1682 | 1682 | } |
| 1683 | 1683 | public function getPreviousLink() { |
| 1684 | 1684 | return $this->previousLink; |
| 1685 | 1685 | } |
| 1686 | - public function setStartIndex( $startIndex) { |
|
| 1686 | + public function setStartIndex($startIndex) { |
|
| 1687 | 1687 | $this->startIndex = $startIndex; |
| 1688 | 1688 | } |
| 1689 | 1689 | public function getStartIndex() { |
| 1690 | 1690 | return $this->startIndex; |
| 1691 | 1691 | } |
| 1692 | - public function setTotalResults( $totalResults) { |
|
| 1692 | + public function setTotalResults($totalResults) { |
|
| 1693 | 1693 | $this->totalResults = $totalResults; |
| 1694 | 1694 | } |
| 1695 | 1695 | public function getTotalResults() { |
| 1696 | 1696 | return $this->totalResults; |
| 1697 | 1697 | } |
| 1698 | - public function setUsername( $username) { |
|
| 1698 | + public function setUsername($username) { |
|
| 1699 | 1699 | $this->username = $username; |
| 1700 | 1700 | } |
| 1701 | 1701 | public function getUsername() { |
@@ -1719,43 +1719,43 @@ discard block |
||
| 1719 | 1719 | public $recentChanges; |
| 1720 | 1720 | public $selfLink; |
| 1721 | 1721 | public $webPropertyId; |
| 1722 | - public function setAccountId( $accountId) { |
|
| 1722 | + public function setAccountId($accountId) { |
|
| 1723 | 1723 | $this->accountId = $accountId; |
| 1724 | 1724 | } |
| 1725 | 1725 | public function getAccountId() { |
| 1726 | 1726 | return $this->accountId; |
| 1727 | 1727 | } |
| 1728 | - public function setAppendCount( $appendCount) { |
|
| 1728 | + public function setAppendCount($appendCount) { |
|
| 1729 | 1729 | $this->appendCount = $appendCount; |
| 1730 | 1730 | } |
| 1731 | 1731 | public function getAppendCount() { |
| 1732 | 1732 | return $this->appendCount; |
| 1733 | 1733 | } |
| 1734 | - public function setCreatedTime( $createdTime) { |
|
| 1734 | + public function setCreatedTime($createdTime) { |
|
| 1735 | 1735 | $this->createdTime = $createdTime; |
| 1736 | 1736 | } |
| 1737 | 1737 | public function getCreatedTime() { |
| 1738 | 1738 | return $this->createdTime; |
| 1739 | 1739 | } |
| 1740 | - public function setCustomDataSourceId( $customDataSourceId) { |
|
| 1740 | + public function setCustomDataSourceId($customDataSourceId) { |
|
| 1741 | 1741 | $this->customDataSourceId = $customDataSourceId; |
| 1742 | 1742 | } |
| 1743 | 1743 | public function getCustomDataSourceId() { |
| 1744 | 1744 | return $this->customDataSourceId; |
| 1745 | 1745 | } |
| 1746 | - public function setDate( $date) { |
|
| 1746 | + public function setDate($date) { |
|
| 1747 | 1747 | $this->date = $date; |
| 1748 | 1748 | } |
| 1749 | 1749 | public function getDate() { |
| 1750 | 1750 | return $this->date; |
| 1751 | 1751 | } |
| 1752 | - public function setKind( $kind) { |
|
| 1752 | + public function setKind($kind) { |
|
| 1753 | 1753 | $this->kind = $kind; |
| 1754 | 1754 | } |
| 1755 | 1755 | public function getKind() { |
| 1756 | 1756 | return $this->kind; |
| 1757 | 1757 | } |
| 1758 | - public function setModifiedTime( $modifiedTime) { |
|
| 1758 | + public function setModifiedTime($modifiedTime) { |
|
| 1759 | 1759 | $this->modifiedTime = $modifiedTime; |
| 1760 | 1760 | } |
| 1761 | 1761 | public function getModifiedTime() { |
@@ -1774,13 +1774,13 @@ discard block |
||
| 1774 | 1774 | public function getRecentChanges() { |
| 1775 | 1775 | return $this->recentChanges; |
| 1776 | 1776 | } |
| 1777 | - public function setSelfLink( $selfLink) { |
|
| 1777 | + public function setSelfLink($selfLink) { |
|
| 1778 | 1778 | $this->selfLink = $selfLink; |
| 1779 | 1779 | } |
| 1780 | 1780 | public function getSelfLink() { |
| 1781 | 1781 | return $this->selfLink; |
| 1782 | 1782 | } |
| 1783 | - public function setWebPropertyId( $webPropertyId) { |
|
| 1783 | + public function setWebPropertyId($webPropertyId) { |
|
| 1784 | 1784 | $this->webPropertyId = $webPropertyId; |
| 1785 | 1785 | } |
| 1786 | 1786 | public function getWebPropertyId() { |
@@ -1796,43 +1796,43 @@ discard block |
||
| 1796 | 1796 | public $kind; |
| 1797 | 1797 | public $nextAppendLink; |
| 1798 | 1798 | public $webPropertyId; |
| 1799 | - public function setAccountId( $accountId) { |
|
| 1799 | + public function setAccountId($accountId) { |
|
| 1800 | 1800 | $this->accountId = $accountId; |
| 1801 | 1801 | } |
| 1802 | 1802 | public function getAccountId() { |
| 1803 | 1803 | return $this->accountId; |
| 1804 | 1804 | } |
| 1805 | - public function setAppendNumber( $appendNumber) { |
|
| 1805 | + public function setAppendNumber($appendNumber) { |
|
| 1806 | 1806 | $this->appendNumber = $appendNumber; |
| 1807 | 1807 | } |
| 1808 | 1808 | public function getAppendNumber() { |
| 1809 | 1809 | return $this->appendNumber; |
| 1810 | 1810 | } |
| 1811 | - public function setCustomDataSourceId( $customDataSourceId) { |
|
| 1811 | + public function setCustomDataSourceId($customDataSourceId) { |
|
| 1812 | 1812 | $this->customDataSourceId = $customDataSourceId; |
| 1813 | 1813 | } |
| 1814 | 1814 | public function getCustomDataSourceId() { |
| 1815 | 1815 | return $this->customDataSourceId; |
| 1816 | 1816 | } |
| 1817 | - public function setDate( $date) { |
|
| 1817 | + public function setDate($date) { |
|
| 1818 | 1818 | $this->date = $date; |
| 1819 | 1819 | } |
| 1820 | 1820 | public function getDate() { |
| 1821 | 1821 | return $this->date; |
| 1822 | 1822 | } |
| 1823 | - public function setKind( $kind) { |
|
| 1823 | + public function setKind($kind) { |
|
| 1824 | 1824 | $this->kind = $kind; |
| 1825 | 1825 | } |
| 1826 | 1826 | public function getKind() { |
| 1827 | 1827 | return $this->kind; |
| 1828 | 1828 | } |
| 1829 | - public function setNextAppendLink( $nextAppendLink) { |
|
| 1829 | + public function setNextAppendLink($nextAppendLink) { |
|
| 1830 | 1830 | $this->nextAppendLink = $nextAppendLink; |
| 1831 | 1831 | } |
| 1832 | 1832 | public function getNextAppendLink() { |
| 1833 | 1833 | return $this->nextAppendLink; |
| 1834 | 1834 | } |
| 1835 | - public function setWebPropertyId( $webPropertyId) { |
|
| 1835 | + public function setWebPropertyId($webPropertyId) { |
|
| 1836 | 1836 | $this->webPropertyId = $webPropertyId; |
| 1837 | 1837 | } |
| 1838 | 1838 | public function getWebPropertyId() { |
@@ -1843,13 +1843,13 @@ discard block |
||
| 1843 | 1843 | class Google_DailyUploadParentLink extends Google_Model { |
| 1844 | 1844 | public $href; |
| 1845 | 1845 | public $type; |
| 1846 | - public function setHref( $href) { |
|
| 1846 | + public function setHref($href) { |
|
| 1847 | 1847 | $this->href = $href; |
| 1848 | 1848 | } |
| 1849 | 1849 | public function getHref() { |
| 1850 | 1850 | return $this->href; |
| 1851 | 1851 | } |
| 1852 | - public function setType( $type) { |
|
| 1852 | + public function setType($type) { |
|
| 1853 | 1853 | $this->type = $type; |
| 1854 | 1854 | } |
| 1855 | 1855 | public function getType() { |
@@ -1860,13 +1860,13 @@ discard block |
||
| 1860 | 1860 | class Google_DailyUploadRecentChanges extends Google_Model { |
| 1861 | 1861 | public $change; |
| 1862 | 1862 | public $time; |
| 1863 | - public function setChange( $change) { |
|
| 1863 | + public function setChange($change) { |
|
| 1864 | 1864 | $this->change = $change; |
| 1865 | 1865 | } |
| 1866 | 1866 | public function getChange() { |
| 1867 | 1867 | return $this->change; |
| 1868 | 1868 | } |
| 1869 | - public function setTime( $time) { |
|
| 1869 | + public function setTime($time) { |
|
| 1870 | 1870 | $this->time = $time; |
| 1871 | 1871 | } |
| 1872 | 1872 | public function getTime() { |
@@ -1892,43 +1892,43 @@ discard block |
||
| 1892 | 1892 | public function getItems() { |
| 1893 | 1893 | return $this->items; |
| 1894 | 1894 | } |
| 1895 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 1895 | + public function setItemsPerPage($itemsPerPage) { |
|
| 1896 | 1896 | $this->itemsPerPage = $itemsPerPage; |
| 1897 | 1897 | } |
| 1898 | 1898 | public function getItemsPerPage() { |
| 1899 | 1899 | return $this->itemsPerPage; |
| 1900 | 1900 | } |
| 1901 | - public function setKind( $kind) { |
|
| 1901 | + public function setKind($kind) { |
|
| 1902 | 1902 | $this->kind = $kind; |
| 1903 | 1903 | } |
| 1904 | 1904 | public function getKind() { |
| 1905 | 1905 | return $this->kind; |
| 1906 | 1906 | } |
| 1907 | - public function setNextLink( $nextLink) { |
|
| 1907 | + public function setNextLink($nextLink) { |
|
| 1908 | 1908 | $this->nextLink = $nextLink; |
| 1909 | 1909 | } |
| 1910 | 1910 | public function getNextLink() { |
| 1911 | 1911 | return $this->nextLink; |
| 1912 | 1912 | } |
| 1913 | - public function setPreviousLink( $previousLink) { |
|
| 1913 | + public function setPreviousLink($previousLink) { |
|
| 1914 | 1914 | $this->previousLink = $previousLink; |
| 1915 | 1915 | } |
| 1916 | 1916 | public function getPreviousLink() { |
| 1917 | 1917 | return $this->previousLink; |
| 1918 | 1918 | } |
| 1919 | - public function setStartIndex( $startIndex) { |
|
| 1919 | + public function setStartIndex($startIndex) { |
|
| 1920 | 1920 | $this->startIndex = $startIndex; |
| 1921 | 1921 | } |
| 1922 | 1922 | public function getStartIndex() { |
| 1923 | 1923 | return $this->startIndex; |
| 1924 | 1924 | } |
| 1925 | - public function setTotalResults( $totalResults) { |
|
| 1925 | + public function setTotalResults($totalResults) { |
|
| 1926 | 1926 | $this->totalResults = $totalResults; |
| 1927 | 1927 | } |
| 1928 | 1928 | public function getTotalResults() { |
| 1929 | 1929 | return $this->totalResults; |
| 1930 | 1930 | } |
| 1931 | - public function setUsername( $username) { |
|
| 1931 | + public function setUsername($username) { |
|
| 1932 | 1932 | $this->username = $username; |
| 1933 | 1933 | } |
| 1934 | 1934 | public function getUsername() { |
@@ -1955,13 +1955,13 @@ discard block |
||
| 1955 | 1955 | public function getEntity() { |
| 1956 | 1956 | return $this->entity; |
| 1957 | 1957 | } |
| 1958 | - public function setId( $id) { |
|
| 1958 | + public function setId($id) { |
|
| 1959 | 1959 | $this->id = $id; |
| 1960 | 1960 | } |
| 1961 | 1961 | public function getId() { |
| 1962 | 1962 | return $this->id; |
| 1963 | 1963 | } |
| 1964 | - public function setKind( $kind) { |
|
| 1964 | + public function setKind($kind) { |
|
| 1965 | 1965 | $this->kind = $kind; |
| 1966 | 1966 | } |
| 1967 | 1967 | public function getKind() { |
@@ -1973,7 +1973,7 @@ discard block |
||
| 1973 | 1973 | public function getPermissions() { |
| 1974 | 1974 | return $this->permissions; |
| 1975 | 1975 | } |
| 1976 | - public function setSelfLink( $selfLink) { |
|
| 1976 | + public function setSelfLink($selfLink) { |
|
| 1977 | 1977 | $this->selfLink = $selfLink; |
| 1978 | 1978 | } |
| 1979 | 1979 | public function getSelfLink() { |
@@ -2053,37 +2053,37 @@ discard block |
||
| 2053 | 2053 | public function getItems() { |
| 2054 | 2054 | return $this->items; |
| 2055 | 2055 | } |
| 2056 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 2056 | + public function setItemsPerPage($itemsPerPage) { |
|
| 2057 | 2057 | $this->itemsPerPage = $itemsPerPage; |
| 2058 | 2058 | } |
| 2059 | 2059 | public function getItemsPerPage() { |
| 2060 | 2060 | return $this->itemsPerPage; |
| 2061 | 2061 | } |
| 2062 | - public function setKind( $kind) { |
|
| 2062 | + public function setKind($kind) { |
|
| 2063 | 2063 | $this->kind = $kind; |
| 2064 | 2064 | } |
| 2065 | 2065 | public function getKind() { |
| 2066 | 2066 | return $this->kind; |
| 2067 | 2067 | } |
| 2068 | - public function setNextLink( $nextLink) { |
|
| 2068 | + public function setNextLink($nextLink) { |
|
| 2069 | 2069 | $this->nextLink = $nextLink; |
| 2070 | 2070 | } |
| 2071 | 2071 | public function getNextLink() { |
| 2072 | 2072 | return $this->nextLink; |
| 2073 | 2073 | } |
| 2074 | - public function setPreviousLink( $previousLink) { |
|
| 2074 | + public function setPreviousLink($previousLink) { |
|
| 2075 | 2075 | $this->previousLink = $previousLink; |
| 2076 | 2076 | } |
| 2077 | 2077 | public function getPreviousLink() { |
| 2078 | 2078 | return $this->previousLink; |
| 2079 | 2079 | } |
| 2080 | - public function setStartIndex( $startIndex) { |
|
| 2080 | + public function setStartIndex($startIndex) { |
|
| 2081 | 2081 | $this->startIndex = $startIndex; |
| 2082 | 2082 | } |
| 2083 | 2083 | public function getStartIndex() { |
| 2084 | 2084 | return $this->startIndex; |
| 2085 | 2085 | } |
| 2086 | - public function setTotalResults( $totalResults) { |
|
| 2086 | + public function setTotalResults($totalResults) { |
|
| 2087 | 2087 | $this->totalResults = $totalResults; |
| 2088 | 2088 | } |
| 2089 | 2089 | public function getTotalResults() { |
@@ -2123,73 +2123,73 @@ discard block |
||
| 2123 | 2123 | public $webPropertyId; |
| 2124 | 2124 | public $winnerConfidenceLevel; |
| 2125 | 2125 | public $winnerFound; |
| 2126 | - public function setAccountId( $accountId) { |
|
| 2126 | + public function setAccountId($accountId) { |
|
| 2127 | 2127 | $this->accountId = $accountId; |
| 2128 | 2128 | } |
| 2129 | 2129 | public function getAccountId() { |
| 2130 | 2130 | return $this->accountId; |
| 2131 | 2131 | } |
| 2132 | - public function setCreated( $created) { |
|
| 2132 | + public function setCreated($created) { |
|
| 2133 | 2133 | $this->created = $created; |
| 2134 | 2134 | } |
| 2135 | 2135 | public function getCreated() { |
| 2136 | 2136 | return $this->created; |
| 2137 | 2137 | } |
| 2138 | - public function setDescription( $description) { |
|
| 2138 | + public function setDescription($description) { |
|
| 2139 | 2139 | $this->description = $description; |
| 2140 | 2140 | } |
| 2141 | 2141 | public function getDescription() { |
| 2142 | 2142 | return $this->description; |
| 2143 | 2143 | } |
| 2144 | - public function setEditableInGaUi( $editableInGaUi) { |
|
| 2144 | + public function setEditableInGaUi($editableInGaUi) { |
|
| 2145 | 2145 | $this->editableInGaUi = $editableInGaUi; |
| 2146 | 2146 | } |
| 2147 | 2147 | public function getEditableInGaUi() { |
| 2148 | 2148 | return $this->editableInGaUi; |
| 2149 | 2149 | } |
| 2150 | - public function setEndTime( $endTime) { |
|
| 2150 | + public function setEndTime($endTime) { |
|
| 2151 | 2151 | $this->endTime = $endTime; |
| 2152 | 2152 | } |
| 2153 | 2153 | public function getEndTime() { |
| 2154 | 2154 | return $this->endTime; |
| 2155 | 2155 | } |
| 2156 | - public function setId( $id) { |
|
| 2156 | + public function setId($id) { |
|
| 2157 | 2157 | $this->id = $id; |
| 2158 | 2158 | } |
| 2159 | 2159 | public function getId() { |
| 2160 | 2160 | return $this->id; |
| 2161 | 2161 | } |
| 2162 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 2162 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 2163 | 2163 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 2164 | 2164 | } |
| 2165 | 2165 | public function getInternalWebPropertyId() { |
| 2166 | 2166 | return $this->internalWebPropertyId; |
| 2167 | 2167 | } |
| 2168 | - public function setKind( $kind) { |
|
| 2168 | + public function setKind($kind) { |
|
| 2169 | 2169 | $this->kind = $kind; |
| 2170 | 2170 | } |
| 2171 | 2171 | public function getKind() { |
| 2172 | 2172 | return $this->kind; |
| 2173 | 2173 | } |
| 2174 | - public function setMinimumExperimentLengthInDays( $minimumExperimentLengthInDays) { |
|
| 2174 | + public function setMinimumExperimentLengthInDays($minimumExperimentLengthInDays) { |
|
| 2175 | 2175 | $this->minimumExperimentLengthInDays = $minimumExperimentLengthInDays; |
| 2176 | 2176 | } |
| 2177 | 2177 | public function getMinimumExperimentLengthInDays() { |
| 2178 | 2178 | return $this->minimumExperimentLengthInDays; |
| 2179 | 2179 | } |
| 2180 | - public function setName( $name) { |
|
| 2180 | + public function setName($name) { |
|
| 2181 | 2181 | $this->name = $name; |
| 2182 | 2182 | } |
| 2183 | 2183 | public function getName() { |
| 2184 | 2184 | return $this->name; |
| 2185 | 2185 | } |
| 2186 | - public function setObjectiveMetric( $objectiveMetric) { |
|
| 2186 | + public function setObjectiveMetric($objectiveMetric) { |
|
| 2187 | 2187 | $this->objectiveMetric = $objectiveMetric; |
| 2188 | 2188 | } |
| 2189 | 2189 | public function getObjectiveMetric() { |
| 2190 | 2190 | return $this->objectiveMetric; |
| 2191 | 2191 | } |
| 2192 | - public function setOptimizationType( $optimizationType) { |
|
| 2192 | + public function setOptimizationType($optimizationType) { |
|
| 2193 | 2193 | $this->optimizationType = $optimizationType; |
| 2194 | 2194 | } |
| 2195 | 2195 | public function getOptimizationType() { |
@@ -2201,61 +2201,61 @@ discard block |
||
| 2201 | 2201 | public function getParentLink() { |
| 2202 | 2202 | return $this->parentLink; |
| 2203 | 2203 | } |
| 2204 | - public function setProfileId( $profileId) { |
|
| 2204 | + public function setProfileId($profileId) { |
|
| 2205 | 2205 | $this->profileId = $profileId; |
| 2206 | 2206 | } |
| 2207 | 2207 | public function getProfileId() { |
| 2208 | 2208 | return $this->profileId; |
| 2209 | 2209 | } |
| 2210 | - public function setReasonExperimentEnded( $reasonExperimentEnded) { |
|
| 2210 | + public function setReasonExperimentEnded($reasonExperimentEnded) { |
|
| 2211 | 2211 | $this->reasonExperimentEnded = $reasonExperimentEnded; |
| 2212 | 2212 | } |
| 2213 | 2213 | public function getReasonExperimentEnded() { |
| 2214 | 2214 | return $this->reasonExperimentEnded; |
| 2215 | 2215 | } |
| 2216 | - public function setRewriteVariationUrlsAsOriginal( $rewriteVariationUrlsAsOriginal) { |
|
| 2216 | + public function setRewriteVariationUrlsAsOriginal($rewriteVariationUrlsAsOriginal) { |
|
| 2217 | 2217 | $this->rewriteVariationUrlsAsOriginal = $rewriteVariationUrlsAsOriginal; |
| 2218 | 2218 | } |
| 2219 | 2219 | public function getRewriteVariationUrlsAsOriginal() { |
| 2220 | 2220 | return $this->rewriteVariationUrlsAsOriginal; |
| 2221 | 2221 | } |
| 2222 | - public function setSelfLink( $selfLink) { |
|
| 2222 | + public function setSelfLink($selfLink) { |
|
| 2223 | 2223 | $this->selfLink = $selfLink; |
| 2224 | 2224 | } |
| 2225 | 2225 | public function getSelfLink() { |
| 2226 | 2226 | return $this->selfLink; |
| 2227 | 2227 | } |
| 2228 | - public function setServingFramework( $servingFramework) { |
|
| 2228 | + public function setServingFramework($servingFramework) { |
|
| 2229 | 2229 | $this->servingFramework = $servingFramework; |
| 2230 | 2230 | } |
| 2231 | 2231 | public function getServingFramework() { |
| 2232 | 2232 | return $this->servingFramework; |
| 2233 | 2233 | } |
| 2234 | - public function setSnippet( $snippet) { |
|
| 2234 | + public function setSnippet($snippet) { |
|
| 2235 | 2235 | $this->snippet = $snippet; |
| 2236 | 2236 | } |
| 2237 | 2237 | public function getSnippet() { |
| 2238 | 2238 | return $this->snippet; |
| 2239 | 2239 | } |
| 2240 | - public function setStartTime( $startTime) { |
|
| 2240 | + public function setStartTime($startTime) { |
|
| 2241 | 2241 | $this->startTime = $startTime; |
| 2242 | 2242 | } |
| 2243 | 2243 | public function getStartTime() { |
| 2244 | 2244 | return $this->startTime; |
| 2245 | 2245 | } |
| 2246 | - public function setStatus( $status) { |
|
| 2246 | + public function setStatus($status) { |
|
| 2247 | 2247 | $this->status = $status; |
| 2248 | 2248 | } |
| 2249 | 2249 | public function getStatus() { |
| 2250 | 2250 | return $this->status; |
| 2251 | 2251 | } |
| 2252 | - public function setTrafficCoverage( $trafficCoverage) { |
|
| 2252 | + public function setTrafficCoverage($trafficCoverage) { |
|
| 2253 | 2253 | $this->trafficCoverage = $trafficCoverage; |
| 2254 | 2254 | } |
| 2255 | 2255 | public function getTrafficCoverage() { |
| 2256 | 2256 | return $this->trafficCoverage; |
| 2257 | 2257 | } |
| 2258 | - public function setUpdated( $updated) { |
|
| 2258 | + public function setUpdated($updated) { |
|
| 2259 | 2259 | $this->updated = $updated; |
| 2260 | 2260 | } |
| 2261 | 2261 | public function getUpdated() { |
@@ -2268,19 +2268,19 @@ discard block |
||
| 2268 | 2268 | public function getVariations() { |
| 2269 | 2269 | return $this->variations; |
| 2270 | 2270 | } |
| 2271 | - public function setWebPropertyId( $webPropertyId) { |
|
| 2271 | + public function setWebPropertyId($webPropertyId) { |
|
| 2272 | 2272 | $this->webPropertyId = $webPropertyId; |
| 2273 | 2273 | } |
| 2274 | 2274 | public function getWebPropertyId() { |
| 2275 | 2275 | return $this->webPropertyId; |
| 2276 | 2276 | } |
| 2277 | - public function setWinnerConfidenceLevel( $winnerConfidenceLevel) { |
|
| 2277 | + public function setWinnerConfidenceLevel($winnerConfidenceLevel) { |
|
| 2278 | 2278 | $this->winnerConfidenceLevel = $winnerConfidenceLevel; |
| 2279 | 2279 | } |
| 2280 | 2280 | public function getWinnerConfidenceLevel() { |
| 2281 | 2281 | return $this->winnerConfidenceLevel; |
| 2282 | 2282 | } |
| 2283 | - public function setWinnerFound( $winnerFound) { |
|
| 2283 | + public function setWinnerFound($winnerFound) { |
|
| 2284 | 2284 | $this->winnerFound = $winnerFound; |
| 2285 | 2285 | } |
| 2286 | 2286 | public function getWinnerFound() { |
@@ -2291,13 +2291,13 @@ discard block |
||
| 2291 | 2291 | class Google_ExperimentParentLink extends Google_Model { |
| 2292 | 2292 | public $href; |
| 2293 | 2293 | public $type; |
| 2294 | - public function setHref( $href) { |
|
| 2294 | + public function setHref($href) { |
|
| 2295 | 2295 | $this->href = $href; |
| 2296 | 2296 | } |
| 2297 | 2297 | public function getHref() { |
| 2298 | 2298 | return $this->href; |
| 2299 | 2299 | } |
| 2300 | - public function setType( $type) { |
|
| 2300 | + public function setType($type) { |
|
| 2301 | 2301 | $this->type = $type; |
| 2302 | 2302 | } |
| 2303 | 2303 | public function getType() { |
@@ -2311,31 +2311,31 @@ discard block |
||
| 2311 | 2311 | public $url; |
| 2312 | 2312 | public $weight; |
| 2313 | 2313 | public $won; |
| 2314 | - public function setName( $name) { |
|
| 2314 | + public function setName($name) { |
|
| 2315 | 2315 | $this->name = $name; |
| 2316 | 2316 | } |
| 2317 | 2317 | public function getName() { |
| 2318 | 2318 | return $this->name; |
| 2319 | 2319 | } |
| 2320 | - public function setStatus( $status) { |
|
| 2320 | + public function setStatus($status) { |
|
| 2321 | 2321 | $this->status = $status; |
| 2322 | 2322 | } |
| 2323 | 2323 | public function getStatus() { |
| 2324 | 2324 | return $this->status; |
| 2325 | 2325 | } |
| 2326 | - public function setUrl( $url) { |
|
| 2326 | + public function setUrl($url) { |
|
| 2327 | 2327 | $this->url = $url; |
| 2328 | 2328 | } |
| 2329 | 2329 | public function getUrl() { |
| 2330 | 2330 | return $this->url; |
| 2331 | 2331 | } |
| 2332 | - public function setWeight( $weight) { |
|
| 2332 | + public function setWeight($weight) { |
|
| 2333 | 2333 | $this->weight = $weight; |
| 2334 | 2334 | } |
| 2335 | 2335 | public function getWeight() { |
| 2336 | 2336 | return $this->weight; |
| 2337 | 2337 | } |
| 2338 | - public function setWon( $won) { |
|
| 2338 | + public function setWon($won) { |
|
| 2339 | 2339 | $this->won = $won; |
| 2340 | 2340 | } |
| 2341 | 2341 | public function getWon() { |
@@ -2361,43 +2361,43 @@ discard block |
||
| 2361 | 2361 | public function getItems() { |
| 2362 | 2362 | return $this->items; |
| 2363 | 2363 | } |
| 2364 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 2364 | + public function setItemsPerPage($itemsPerPage) { |
|
| 2365 | 2365 | $this->itemsPerPage = $itemsPerPage; |
| 2366 | 2366 | } |
| 2367 | 2367 | public function getItemsPerPage() { |
| 2368 | 2368 | return $this->itemsPerPage; |
| 2369 | 2369 | } |
| 2370 | - public function setKind( $kind) { |
|
| 2370 | + public function setKind($kind) { |
|
| 2371 | 2371 | $this->kind = $kind; |
| 2372 | 2372 | } |
| 2373 | 2373 | public function getKind() { |
| 2374 | 2374 | return $this->kind; |
| 2375 | 2375 | } |
| 2376 | - public function setNextLink( $nextLink) { |
|
| 2376 | + public function setNextLink($nextLink) { |
|
| 2377 | 2377 | $this->nextLink = $nextLink; |
| 2378 | 2378 | } |
| 2379 | 2379 | public function getNextLink() { |
| 2380 | 2380 | return $this->nextLink; |
| 2381 | 2381 | } |
| 2382 | - public function setPreviousLink( $previousLink) { |
|
| 2382 | + public function setPreviousLink($previousLink) { |
|
| 2383 | 2383 | $this->previousLink = $previousLink; |
| 2384 | 2384 | } |
| 2385 | 2385 | public function getPreviousLink() { |
| 2386 | 2386 | return $this->previousLink; |
| 2387 | 2387 | } |
| 2388 | - public function setStartIndex( $startIndex) { |
|
| 2388 | + public function setStartIndex($startIndex) { |
|
| 2389 | 2389 | $this->startIndex = $startIndex; |
| 2390 | 2390 | } |
| 2391 | 2391 | public function getStartIndex() { |
| 2392 | 2392 | return $this->startIndex; |
| 2393 | 2393 | } |
| 2394 | - public function setTotalResults( $totalResults) { |
|
| 2394 | + public function setTotalResults($totalResults) { |
|
| 2395 | 2395 | $this->totalResults = $totalResults; |
| 2396 | 2396 | } |
| 2397 | 2397 | public function getTotalResults() { |
| 2398 | 2398 | return $this->totalResults; |
| 2399 | 2399 | } |
| 2400 | - public function setUsername( $username) { |
|
| 2400 | + public function setUsername($username) { |
|
| 2401 | 2401 | $this->username = $username; |
| 2402 | 2402 | } |
| 2403 | 2403 | public function getUsername() { |
@@ -2432,37 +2432,37 @@ discard block |
||
| 2432 | 2432 | public function getColumnHeaders() { |
| 2433 | 2433 | return $this->columnHeaders; |
| 2434 | 2434 | } |
| 2435 | - public function setContainsSampledData( $containsSampledData) { |
|
| 2435 | + public function setContainsSampledData($containsSampledData) { |
|
| 2436 | 2436 | $this->containsSampledData = $containsSampledData; |
| 2437 | 2437 | } |
| 2438 | 2438 | public function getContainsSampledData() { |
| 2439 | 2439 | return $this->containsSampledData; |
| 2440 | 2440 | } |
| 2441 | - public function setId( $id) { |
|
| 2441 | + public function setId($id) { |
|
| 2442 | 2442 | $this->id = $id; |
| 2443 | 2443 | } |
| 2444 | 2444 | public function getId() { |
| 2445 | 2445 | return $this->id; |
| 2446 | 2446 | } |
| 2447 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 2447 | + public function setItemsPerPage($itemsPerPage) { |
|
| 2448 | 2448 | $this->itemsPerPage = $itemsPerPage; |
| 2449 | 2449 | } |
| 2450 | 2450 | public function getItemsPerPage() { |
| 2451 | 2451 | return $this->itemsPerPage; |
| 2452 | 2452 | } |
| 2453 | - public function setKind( $kind) { |
|
| 2453 | + public function setKind($kind) { |
|
| 2454 | 2454 | $this->kind = $kind; |
| 2455 | 2455 | } |
| 2456 | 2456 | public function getKind() { |
| 2457 | 2457 | return $this->kind; |
| 2458 | 2458 | } |
| 2459 | - public function setNextLink( $nextLink) { |
|
| 2459 | + public function setNextLink($nextLink) { |
|
| 2460 | 2460 | $this->nextLink = $nextLink; |
| 2461 | 2461 | } |
| 2462 | 2462 | public function getNextLink() { |
| 2463 | 2463 | return $this->nextLink; |
| 2464 | 2464 | } |
| 2465 | - public function setPreviousLink( $previousLink) { |
|
| 2465 | + public function setPreviousLink($previousLink) { |
|
| 2466 | 2466 | $this->previousLink = $previousLink; |
| 2467 | 2467 | } |
| 2468 | 2468 | public function getPreviousLink() { |
@@ -2487,19 +2487,19 @@ discard block |
||
| 2487 | 2487 | public function getRows() { |
| 2488 | 2488 | return $this->rows; |
| 2489 | 2489 | } |
| 2490 | - public function setSelfLink( $selfLink) { |
|
| 2490 | + public function setSelfLink($selfLink) { |
|
| 2491 | 2491 | $this->selfLink = $selfLink; |
| 2492 | 2492 | } |
| 2493 | 2493 | public function getSelfLink() { |
| 2494 | 2494 | return $this->selfLink; |
| 2495 | 2495 | } |
| 2496 | - public function setTotalResults( $totalResults) { |
|
| 2496 | + public function setTotalResults($totalResults) { |
|
| 2497 | 2497 | $this->totalResults = $totalResults; |
| 2498 | 2498 | } |
| 2499 | 2499 | public function getTotalResults() { |
| 2500 | 2500 | return $this->totalResults; |
| 2501 | 2501 | } |
| 2502 | - public function setTotalsForAllResults( $totalsForAllResults) { |
|
| 2502 | + public function setTotalsForAllResults($totalsForAllResults) { |
|
| 2503 | 2503 | $this->totalsForAllResults = $totalsForAllResults; |
| 2504 | 2504 | } |
| 2505 | 2505 | public function getTotalsForAllResults() { |
@@ -2511,19 +2511,19 @@ discard block |
||
| 2511 | 2511 | public $columnType; |
| 2512 | 2512 | public $dataType; |
| 2513 | 2513 | public $name; |
| 2514 | - public function setColumnType( $columnType) { |
|
| 2514 | + public function setColumnType($columnType) { |
|
| 2515 | 2515 | $this->columnType = $columnType; |
| 2516 | 2516 | } |
| 2517 | 2517 | public function getColumnType() { |
| 2518 | 2518 | return $this->columnType; |
| 2519 | 2519 | } |
| 2520 | - public function setDataType( $dataType) { |
|
| 2520 | + public function setDataType($dataType) { |
|
| 2521 | 2521 | $this->dataType = $dataType; |
| 2522 | 2522 | } |
| 2523 | 2523 | public function getDataType() { |
| 2524 | 2524 | return $this->dataType; |
| 2525 | 2525 | } |
| 2526 | - public function setName( $name) { |
|
| 2526 | + public function setName($name) { |
|
| 2527 | 2527 | $this->name = $name; |
| 2528 | 2528 | } |
| 2529 | 2529 | public function getName() { |
@@ -2538,37 +2538,37 @@ discard block |
||
| 2538 | 2538 | public $profileName; |
| 2539 | 2539 | public $tableId; |
| 2540 | 2540 | public $webPropertyId; |
| 2541 | - public function setAccountId( $accountId) { |
|
| 2541 | + public function setAccountId($accountId) { |
|
| 2542 | 2542 | $this->accountId = $accountId; |
| 2543 | 2543 | } |
| 2544 | 2544 | public function getAccountId() { |
| 2545 | 2545 | return $this->accountId; |
| 2546 | 2546 | } |
| 2547 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 2547 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 2548 | 2548 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 2549 | 2549 | } |
| 2550 | 2550 | public function getInternalWebPropertyId() { |
| 2551 | 2551 | return $this->internalWebPropertyId; |
| 2552 | 2552 | } |
| 2553 | - public function setProfileId( $profileId) { |
|
| 2553 | + public function setProfileId($profileId) { |
|
| 2554 | 2554 | $this->profileId = $profileId; |
| 2555 | 2555 | } |
| 2556 | 2556 | public function getProfileId() { |
| 2557 | 2557 | return $this->profileId; |
| 2558 | 2558 | } |
| 2559 | - public function setProfileName( $profileName) { |
|
| 2559 | + public function setProfileName($profileName) { |
|
| 2560 | 2560 | $this->profileName = $profileName; |
| 2561 | 2561 | } |
| 2562 | 2562 | public function getProfileName() { |
| 2563 | 2563 | return $this->profileName; |
| 2564 | 2564 | } |
| 2565 | - public function setTableId( $tableId) { |
|
| 2565 | + public function setTableId($tableId) { |
|
| 2566 | 2566 | $this->tableId = $tableId; |
| 2567 | 2567 | } |
| 2568 | 2568 | public function getTableId() { |
| 2569 | 2569 | return $this->tableId; |
| 2570 | 2570 | } |
| 2571 | - public function setWebPropertyId( $webPropertyId) { |
|
| 2571 | + public function setWebPropertyId($webPropertyId) { |
|
| 2572 | 2572 | $this->webPropertyId = $webPropertyId; |
| 2573 | 2573 | } |
| 2574 | 2574 | public function getWebPropertyId() { |
@@ -2587,31 +2587,31 @@ discard block |
||
| 2587 | 2587 | public $sort; |
| 2588 | 2588 | public $start_date; |
| 2589 | 2589 | public $start_index; |
| 2590 | - public function setDimensions( $dimensions) { |
|
| 2590 | + public function setDimensions($dimensions) { |
|
| 2591 | 2591 | $this->dimensions = $dimensions; |
| 2592 | 2592 | } |
| 2593 | 2593 | public function getDimensions() { |
| 2594 | 2594 | return $this->dimensions; |
| 2595 | 2595 | } |
| 2596 | - public function setEnd_date( $end_date) { |
|
| 2596 | + public function setEnd_date($end_date) { |
|
| 2597 | 2597 | $this->end_date = $end_date; |
| 2598 | 2598 | } |
| 2599 | 2599 | public function getEnd_date() { |
| 2600 | 2600 | return $this->end_date; |
| 2601 | 2601 | } |
| 2602 | - public function setFilters( $filters) { |
|
| 2602 | + public function setFilters($filters) { |
|
| 2603 | 2603 | $this->filters = $filters; |
| 2604 | 2604 | } |
| 2605 | 2605 | public function getFilters() { |
| 2606 | 2606 | return $this->filters; |
| 2607 | 2607 | } |
| 2608 | - public function setIds( $ids) { |
|
| 2608 | + public function setIds($ids) { |
|
| 2609 | 2609 | $this->ids = $ids; |
| 2610 | 2610 | } |
| 2611 | 2611 | public function getIds() { |
| 2612 | 2612 | return $this->ids; |
| 2613 | 2613 | } |
| 2614 | - public function setMax_results( $max_results) { |
|
| 2614 | + public function setMax_results($max_results) { |
|
| 2615 | 2615 | $this->max_results = $max_results; |
| 2616 | 2616 | } |
| 2617 | 2617 | public function getMax_results() { |
@@ -2624,7 +2624,7 @@ discard block |
||
| 2624 | 2624 | public function getMetrics() { |
| 2625 | 2625 | return $this->metrics; |
| 2626 | 2626 | } |
| 2627 | - public function setSegment( $segment) { |
|
| 2627 | + public function setSegment($segment) { |
|
| 2628 | 2628 | $this->segment = $segment; |
| 2629 | 2629 | } |
| 2630 | 2630 | public function getSegment() { |
@@ -2637,13 +2637,13 @@ discard block |
||
| 2637 | 2637 | public function getSort() { |
| 2638 | 2638 | return $this->sort; |
| 2639 | 2639 | } |
| 2640 | - public function setStart_date( $start_date) { |
|
| 2640 | + public function setStart_date($start_date) { |
|
| 2641 | 2641 | $this->start_date = $start_date; |
| 2642 | 2642 | } |
| 2643 | 2643 | public function getStart_date() { |
| 2644 | 2644 | return $this->start_date; |
| 2645 | 2645 | } |
| 2646 | - public function setStart_index( $start_index) { |
|
| 2646 | + public function setStart_index($start_index) { |
|
| 2647 | 2647 | $this->start_index = $start_index; |
| 2648 | 2648 | } |
| 2649 | 2649 | public function getStart_index() { |
@@ -2680,19 +2680,19 @@ discard block |
||
| 2680 | 2680 | protected $__visitTimeOnSiteDetailsDataType = ''; |
| 2681 | 2681 | public $visitTimeOnSiteDetails; |
| 2682 | 2682 | public $webPropertyId; |
| 2683 | - public function setAccountId( $accountId) { |
|
| 2683 | + public function setAccountId($accountId) { |
|
| 2684 | 2684 | $this->accountId = $accountId; |
| 2685 | 2685 | } |
| 2686 | 2686 | public function getAccountId() { |
| 2687 | 2687 | return $this->accountId; |
| 2688 | 2688 | } |
| 2689 | - public function setActive( $active) { |
|
| 2689 | + public function setActive($active) { |
|
| 2690 | 2690 | $this->active = $active; |
| 2691 | 2691 | } |
| 2692 | 2692 | public function getActive() { |
| 2693 | 2693 | return $this->active; |
| 2694 | 2694 | } |
| 2695 | - public function setCreated( $created) { |
|
| 2695 | + public function setCreated($created) { |
|
| 2696 | 2696 | $this->created = $created; |
| 2697 | 2697 | } |
| 2698 | 2698 | public function getCreated() { |
@@ -2704,25 +2704,25 @@ discard block |
||
| 2704 | 2704 | public function getEventDetails() { |
| 2705 | 2705 | return $this->eventDetails; |
| 2706 | 2706 | } |
| 2707 | - public function setId( $id) { |
|
| 2707 | + public function setId($id) { |
|
| 2708 | 2708 | $this->id = $id; |
| 2709 | 2709 | } |
| 2710 | 2710 | public function getId() { |
| 2711 | 2711 | return $this->id; |
| 2712 | 2712 | } |
| 2713 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 2713 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 2714 | 2714 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 2715 | 2715 | } |
| 2716 | 2716 | public function getInternalWebPropertyId() { |
| 2717 | 2717 | return $this->internalWebPropertyId; |
| 2718 | 2718 | } |
| 2719 | - public function setKind( $kind) { |
|
| 2719 | + public function setKind($kind) { |
|
| 2720 | 2720 | $this->kind = $kind; |
| 2721 | 2721 | } |
| 2722 | 2722 | public function getKind() { |
| 2723 | 2723 | return $this->kind; |
| 2724 | 2724 | } |
| 2725 | - public function setName( $name) { |
|
| 2725 | + public function setName($name) { |
|
| 2726 | 2726 | $this->name = $name; |
| 2727 | 2727 | } |
| 2728 | 2728 | public function getName() { |
@@ -2734,25 +2734,25 @@ discard block |
||
| 2734 | 2734 | public function getParentLink() { |
| 2735 | 2735 | return $this->parentLink; |
| 2736 | 2736 | } |
| 2737 | - public function setProfileId( $profileId) { |
|
| 2737 | + public function setProfileId($profileId) { |
|
| 2738 | 2738 | $this->profileId = $profileId; |
| 2739 | 2739 | } |
| 2740 | 2740 | public function getProfileId() { |
| 2741 | 2741 | return $this->profileId; |
| 2742 | 2742 | } |
| 2743 | - public function setSelfLink( $selfLink) { |
|
| 2743 | + public function setSelfLink($selfLink) { |
|
| 2744 | 2744 | $this->selfLink = $selfLink; |
| 2745 | 2745 | } |
| 2746 | 2746 | public function getSelfLink() { |
| 2747 | 2747 | return $this->selfLink; |
| 2748 | 2748 | } |
| 2749 | - public function setType( $type) { |
|
| 2749 | + public function setType($type) { |
|
| 2750 | 2750 | $this->type = $type; |
| 2751 | 2751 | } |
| 2752 | 2752 | public function getType() { |
| 2753 | 2753 | return $this->type; |
| 2754 | 2754 | } |
| 2755 | - public function setUpdated( $updated) { |
|
| 2755 | + public function setUpdated($updated) { |
|
| 2756 | 2756 | $this->updated = $updated; |
| 2757 | 2757 | } |
| 2758 | 2758 | public function getUpdated() { |
@@ -2764,7 +2764,7 @@ discard block |
||
| 2764 | 2764 | public function getUrlDestinationDetails() { |
| 2765 | 2765 | return $this->urlDestinationDetails; |
| 2766 | 2766 | } |
| 2767 | - public function setValue( $value) { |
|
| 2767 | + public function setValue($value) { |
|
| 2768 | 2768 | $this->value = $value; |
| 2769 | 2769 | } |
| 2770 | 2770 | public function getValue() { |
@@ -2782,7 +2782,7 @@ discard block |
||
| 2782 | 2782 | public function getVisitTimeOnSiteDetails() { |
| 2783 | 2783 | return $this->visitTimeOnSiteDetails; |
| 2784 | 2784 | } |
| 2785 | - public function setWebPropertyId( $webPropertyId) { |
|
| 2785 | + public function setWebPropertyId($webPropertyId) { |
|
| 2786 | 2786 | $this->webPropertyId = $webPropertyId; |
| 2787 | 2787 | } |
| 2788 | 2788 | public function getWebPropertyId() { |
@@ -2802,7 +2802,7 @@ discard block |
||
| 2802 | 2802 | public function getEventConditions() { |
| 2803 | 2803 | return $this->eventConditions; |
| 2804 | 2804 | } |
| 2805 | - public function setUseEventValue( $useEventValue) { |
|
| 2805 | + public function setUseEventValue($useEventValue) { |
|
| 2806 | 2806 | $this->useEventValue = $useEventValue; |
| 2807 | 2807 | } |
| 2808 | 2808 | public function getUseEventValue() { |
@@ -2816,31 +2816,31 @@ discard block |
||
| 2816 | 2816 | public $expression; |
| 2817 | 2817 | public $matchType; |
| 2818 | 2818 | public $type; |
| 2819 | - public function setComparisonType( $comparisonType) { |
|
| 2819 | + public function setComparisonType($comparisonType) { |
|
| 2820 | 2820 | $this->comparisonType = $comparisonType; |
| 2821 | 2821 | } |
| 2822 | 2822 | public function getComparisonType() { |
| 2823 | 2823 | return $this->comparisonType; |
| 2824 | 2824 | } |
| 2825 | - public function setComparisonValue( $comparisonValue) { |
|
| 2825 | + public function setComparisonValue($comparisonValue) { |
|
| 2826 | 2826 | $this->comparisonValue = $comparisonValue; |
| 2827 | 2827 | } |
| 2828 | 2828 | public function getComparisonValue() { |
| 2829 | 2829 | return $this->comparisonValue; |
| 2830 | 2830 | } |
| 2831 | - public function setExpression( $expression) { |
|
| 2831 | + public function setExpression($expression) { |
|
| 2832 | 2832 | $this->expression = $expression; |
| 2833 | 2833 | } |
| 2834 | 2834 | public function getExpression() { |
| 2835 | 2835 | return $this->expression; |
| 2836 | 2836 | } |
| 2837 | - public function setMatchType( $matchType) { |
|
| 2837 | + public function setMatchType($matchType) { |
|
| 2838 | 2838 | $this->matchType = $matchType; |
| 2839 | 2839 | } |
| 2840 | 2840 | public function getMatchType() { |
| 2841 | 2841 | return $this->matchType; |
| 2842 | 2842 | } |
| 2843 | - public function setType( $type) { |
|
| 2843 | + public function setType($type) { |
|
| 2844 | 2844 | $this->type = $type; |
| 2845 | 2845 | } |
| 2846 | 2846 | public function getType() { |
@@ -2851,13 +2851,13 @@ discard block |
||
| 2851 | 2851 | class Google_GoalParentLink extends Google_Model { |
| 2852 | 2852 | public $href; |
| 2853 | 2853 | public $type; |
| 2854 | - public function setHref( $href) { |
|
| 2854 | + public function setHref($href) { |
|
| 2855 | 2855 | $this->href = $href; |
| 2856 | 2856 | } |
| 2857 | 2857 | public function getHref() { |
| 2858 | 2858 | return $this->href; |
| 2859 | 2859 | } |
| 2860 | - public function setType( $type) { |
|
| 2860 | + public function setType($type) { |
|
| 2861 | 2861 | $this->type = $type; |
| 2862 | 2862 | } |
| 2863 | 2863 | public function getType() { |
@@ -2873,19 +2873,19 @@ discard block |
||
| 2873 | 2873 | protected $__stepsDataType = 'array'; |
| 2874 | 2874 | public $steps; |
| 2875 | 2875 | public $url; |
| 2876 | - public function setCaseSensitive( $caseSensitive) { |
|
| 2876 | + public function setCaseSensitive($caseSensitive) { |
|
| 2877 | 2877 | $this->caseSensitive = $caseSensitive; |
| 2878 | 2878 | } |
| 2879 | 2879 | public function getCaseSensitive() { |
| 2880 | 2880 | return $this->caseSensitive; |
| 2881 | 2881 | } |
| 2882 | - public function setFirstStepRequired( $firstStepRequired) { |
|
| 2882 | + public function setFirstStepRequired($firstStepRequired) { |
|
| 2883 | 2883 | $this->firstStepRequired = $firstStepRequired; |
| 2884 | 2884 | } |
| 2885 | 2885 | public function getFirstStepRequired() { |
| 2886 | 2886 | return $this->firstStepRequired; |
| 2887 | 2887 | } |
| 2888 | - public function setMatchType( $matchType) { |
|
| 2888 | + public function setMatchType($matchType) { |
|
| 2889 | 2889 | $this->matchType = $matchType; |
| 2890 | 2890 | } |
| 2891 | 2891 | public function getMatchType() { |
@@ -2898,7 +2898,7 @@ discard block |
||
| 2898 | 2898 | public function getSteps() { |
| 2899 | 2899 | return $this->steps; |
| 2900 | 2900 | } |
| 2901 | - public function setUrl( $url) { |
|
| 2901 | + public function setUrl($url) { |
|
| 2902 | 2902 | $this->url = $url; |
| 2903 | 2903 | } |
| 2904 | 2904 | public function getUrl() { |
@@ -2910,19 +2910,19 @@ discard block |
||
| 2910 | 2910 | public $name; |
| 2911 | 2911 | public $number; |
| 2912 | 2912 | public $url; |
| 2913 | - public function setName( $name) { |
|
| 2913 | + public function setName($name) { |
|
| 2914 | 2914 | $this->name = $name; |
| 2915 | 2915 | } |
| 2916 | 2916 | public function getName() { |
| 2917 | 2917 | return $this->name; |
| 2918 | 2918 | } |
| 2919 | - public function setNumber( $number) { |
|
| 2919 | + public function setNumber($number) { |
|
| 2920 | 2920 | $this->number = $number; |
| 2921 | 2921 | } |
| 2922 | 2922 | public function getNumber() { |
| 2923 | 2923 | return $this->number; |
| 2924 | 2924 | } |
| 2925 | - public function setUrl( $url) { |
|
| 2925 | + public function setUrl($url) { |
|
| 2926 | 2926 | $this->url = $url; |
| 2927 | 2927 | } |
| 2928 | 2928 | public function getUrl() { |
@@ -2933,13 +2933,13 @@ discard block |
||
| 2933 | 2933 | class Google_GoalVisitNumPagesDetails extends Google_Model { |
| 2934 | 2934 | public $comparisonType; |
| 2935 | 2935 | public $comparisonValue; |
| 2936 | - public function setComparisonType( $comparisonType) { |
|
| 2936 | + public function setComparisonType($comparisonType) { |
|
| 2937 | 2937 | $this->comparisonType = $comparisonType; |
| 2938 | 2938 | } |
| 2939 | 2939 | public function getComparisonType() { |
| 2940 | 2940 | return $this->comparisonType; |
| 2941 | 2941 | } |
| 2942 | - public function setComparisonValue( $comparisonValue) { |
|
| 2942 | + public function setComparisonValue($comparisonValue) { |
|
| 2943 | 2943 | $this->comparisonValue = $comparisonValue; |
| 2944 | 2944 | } |
| 2945 | 2945 | public function getComparisonValue() { |
@@ -2950,13 +2950,13 @@ discard block |
||
| 2950 | 2950 | class Google_GoalVisitTimeOnSiteDetails extends Google_Model { |
| 2951 | 2951 | public $comparisonType; |
| 2952 | 2952 | public $comparisonValue; |
| 2953 | - public function setComparisonType( $comparisonType) { |
|
| 2953 | + public function setComparisonType($comparisonType) { |
|
| 2954 | 2954 | $this->comparisonType = $comparisonType; |
| 2955 | 2955 | } |
| 2956 | 2956 | public function getComparisonType() { |
| 2957 | 2957 | return $this->comparisonType; |
| 2958 | 2958 | } |
| 2959 | - public function setComparisonValue( $comparisonValue) { |
|
| 2959 | + public function setComparisonValue($comparisonValue) { |
|
| 2960 | 2960 | $this->comparisonValue = $comparisonValue; |
| 2961 | 2961 | } |
| 2962 | 2962 | public function getComparisonValue() { |
@@ -2982,43 +2982,43 @@ discard block |
||
| 2982 | 2982 | public function getItems() { |
| 2983 | 2983 | return $this->items; |
| 2984 | 2984 | } |
| 2985 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 2985 | + public function setItemsPerPage($itemsPerPage) { |
|
| 2986 | 2986 | $this->itemsPerPage = $itemsPerPage; |
| 2987 | 2987 | } |
| 2988 | 2988 | public function getItemsPerPage() { |
| 2989 | 2989 | return $this->itemsPerPage; |
| 2990 | 2990 | } |
| 2991 | - public function setKind( $kind) { |
|
| 2991 | + public function setKind($kind) { |
|
| 2992 | 2992 | $this->kind = $kind; |
| 2993 | 2993 | } |
| 2994 | 2994 | public function getKind() { |
| 2995 | 2995 | return $this->kind; |
| 2996 | 2996 | } |
| 2997 | - public function setNextLink( $nextLink) { |
|
| 2997 | + public function setNextLink($nextLink) { |
|
| 2998 | 2998 | $this->nextLink = $nextLink; |
| 2999 | 2999 | } |
| 3000 | 3000 | public function getNextLink() { |
| 3001 | 3001 | return $this->nextLink; |
| 3002 | 3002 | } |
| 3003 | - public function setPreviousLink( $previousLink) { |
|
| 3003 | + public function setPreviousLink($previousLink) { |
|
| 3004 | 3004 | $this->previousLink = $previousLink; |
| 3005 | 3005 | } |
| 3006 | 3006 | public function getPreviousLink() { |
| 3007 | 3007 | return $this->previousLink; |
| 3008 | 3008 | } |
| 3009 | - public function setStartIndex( $startIndex) { |
|
| 3009 | + public function setStartIndex($startIndex) { |
|
| 3010 | 3010 | $this->startIndex = $startIndex; |
| 3011 | 3011 | } |
| 3012 | 3012 | public function getStartIndex() { |
| 3013 | 3013 | return $this->startIndex; |
| 3014 | 3014 | } |
| 3015 | - public function setTotalResults( $totalResults) { |
|
| 3015 | + public function setTotalResults($totalResults) { |
|
| 3016 | 3016 | $this->totalResults = $totalResults; |
| 3017 | 3017 | } |
| 3018 | 3018 | public function getTotalResults() { |
| 3019 | 3019 | return $this->totalResults; |
| 3020 | 3020 | } |
| 3021 | - public function setUsername( $username) { |
|
| 3021 | + public function setUsername($username) { |
|
| 3022 | 3022 | $this->username = $username; |
| 3023 | 3023 | } |
| 3024 | 3024 | public function getUsername() { |
@@ -3055,37 +3055,37 @@ discard block |
||
| 3055 | 3055 | public function getColumnHeaders() { |
| 3056 | 3056 | return $this->columnHeaders; |
| 3057 | 3057 | } |
| 3058 | - public function setContainsSampledData( $containsSampledData) { |
|
| 3058 | + public function setContainsSampledData($containsSampledData) { |
|
| 3059 | 3059 | $this->containsSampledData = $containsSampledData; |
| 3060 | 3060 | } |
| 3061 | 3061 | public function getContainsSampledData() { |
| 3062 | 3062 | return $this->containsSampledData; |
| 3063 | 3063 | } |
| 3064 | - public function setId( $id) { |
|
| 3064 | + public function setId($id) { |
|
| 3065 | 3065 | $this->id = $id; |
| 3066 | 3066 | } |
| 3067 | 3067 | public function getId() { |
| 3068 | 3068 | return $this->id; |
| 3069 | 3069 | } |
| 3070 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 3070 | + public function setItemsPerPage($itemsPerPage) { |
|
| 3071 | 3071 | $this->itemsPerPage = $itemsPerPage; |
| 3072 | 3072 | } |
| 3073 | 3073 | public function getItemsPerPage() { |
| 3074 | 3074 | return $this->itemsPerPage; |
| 3075 | 3075 | } |
| 3076 | - public function setKind( $kind) { |
|
| 3076 | + public function setKind($kind) { |
|
| 3077 | 3077 | $this->kind = $kind; |
| 3078 | 3078 | } |
| 3079 | 3079 | public function getKind() { |
| 3080 | 3080 | return $this->kind; |
| 3081 | 3081 | } |
| 3082 | - public function setNextLink( $nextLink) { |
|
| 3082 | + public function setNextLink($nextLink) { |
|
| 3083 | 3083 | $this->nextLink = $nextLink; |
| 3084 | 3084 | } |
| 3085 | 3085 | public function getNextLink() { |
| 3086 | 3086 | return $this->nextLink; |
| 3087 | 3087 | } |
| 3088 | - public function setPreviousLink( $previousLink) { |
|
| 3088 | + public function setPreviousLink($previousLink) { |
|
| 3089 | 3089 | $this->previousLink = $previousLink; |
| 3090 | 3090 | } |
| 3091 | 3091 | public function getPreviousLink() { |
@@ -3110,19 +3110,19 @@ discard block |
||
| 3110 | 3110 | public function getRows() { |
| 3111 | 3111 | return $this->rows; |
| 3112 | 3112 | } |
| 3113 | - public function setSelfLink( $selfLink) { |
|
| 3113 | + public function setSelfLink($selfLink) { |
|
| 3114 | 3114 | $this->selfLink = $selfLink; |
| 3115 | 3115 | } |
| 3116 | 3116 | public function getSelfLink() { |
| 3117 | 3117 | return $this->selfLink; |
| 3118 | 3118 | } |
| 3119 | - public function setTotalResults( $totalResults) { |
|
| 3119 | + public function setTotalResults($totalResults) { |
|
| 3120 | 3120 | $this->totalResults = $totalResults; |
| 3121 | 3121 | } |
| 3122 | 3122 | public function getTotalResults() { |
| 3123 | 3123 | return $this->totalResults; |
| 3124 | 3124 | } |
| 3125 | - public function setTotalsForAllResults( $totalsForAllResults) { |
|
| 3125 | + public function setTotalsForAllResults($totalsForAllResults) { |
|
| 3126 | 3126 | $this->totalsForAllResults = $totalsForAllResults; |
| 3127 | 3127 | } |
| 3128 | 3128 | public function getTotalsForAllResults() { |
@@ -3134,19 +3134,19 @@ discard block |
||
| 3134 | 3134 | public $columnType; |
| 3135 | 3135 | public $dataType; |
| 3136 | 3136 | public $name; |
| 3137 | - public function setColumnType( $columnType) { |
|
| 3137 | + public function setColumnType($columnType) { |
|
| 3138 | 3138 | $this->columnType = $columnType; |
| 3139 | 3139 | } |
| 3140 | 3140 | public function getColumnType() { |
| 3141 | 3141 | return $this->columnType; |
| 3142 | 3142 | } |
| 3143 | - public function setDataType( $dataType) { |
|
| 3143 | + public function setDataType($dataType) { |
|
| 3144 | 3144 | $this->dataType = $dataType; |
| 3145 | 3145 | } |
| 3146 | 3146 | public function getDataType() { |
| 3147 | 3147 | return $this->dataType; |
| 3148 | 3148 | } |
| 3149 | - public function setName( $name) { |
|
| 3149 | + public function setName($name) { |
|
| 3150 | 3150 | $this->name = $name; |
| 3151 | 3151 | } |
| 3152 | 3152 | public function getName() { |
@@ -3161,37 +3161,37 @@ discard block |
||
| 3161 | 3161 | public $profileName; |
| 3162 | 3162 | public $tableId; |
| 3163 | 3163 | public $webPropertyId; |
| 3164 | - public function setAccountId( $accountId) { |
|
| 3164 | + public function setAccountId($accountId) { |
|
| 3165 | 3165 | $this->accountId = $accountId; |
| 3166 | 3166 | } |
| 3167 | 3167 | public function getAccountId() { |
| 3168 | 3168 | return $this->accountId; |
| 3169 | 3169 | } |
| 3170 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 3170 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 3171 | 3171 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 3172 | 3172 | } |
| 3173 | 3173 | public function getInternalWebPropertyId() { |
| 3174 | 3174 | return $this->internalWebPropertyId; |
| 3175 | 3175 | } |
| 3176 | - public function setProfileId( $profileId) { |
|
| 3176 | + public function setProfileId($profileId) { |
|
| 3177 | 3177 | $this->profileId = $profileId; |
| 3178 | 3178 | } |
| 3179 | 3179 | public function getProfileId() { |
| 3180 | 3180 | return $this->profileId; |
| 3181 | 3181 | } |
| 3182 | - public function setProfileName( $profileName) { |
|
| 3182 | + public function setProfileName($profileName) { |
|
| 3183 | 3183 | $this->profileName = $profileName; |
| 3184 | 3184 | } |
| 3185 | 3185 | public function getProfileName() { |
| 3186 | 3186 | return $this->profileName; |
| 3187 | 3187 | } |
| 3188 | - public function setTableId( $tableId) { |
|
| 3188 | + public function setTableId($tableId) { |
|
| 3189 | 3189 | $this->tableId = $tableId; |
| 3190 | 3190 | } |
| 3191 | 3191 | public function getTableId() { |
| 3192 | 3192 | return $this->tableId; |
| 3193 | 3193 | } |
| 3194 | - public function setWebPropertyId( $webPropertyId) { |
|
| 3194 | + public function setWebPropertyId($webPropertyId) { |
|
| 3195 | 3195 | $this->webPropertyId = $webPropertyId; |
| 3196 | 3196 | } |
| 3197 | 3197 | public function getWebPropertyId() { |
@@ -3210,31 +3210,31 @@ discard block |
||
| 3210 | 3210 | public $sort; |
| 3211 | 3211 | public $start_date; |
| 3212 | 3212 | public $start_index; |
| 3213 | - public function setDimensions( $dimensions) { |
|
| 3213 | + public function setDimensions($dimensions) { |
|
| 3214 | 3214 | $this->dimensions = $dimensions; |
| 3215 | 3215 | } |
| 3216 | 3216 | public function getDimensions() { |
| 3217 | 3217 | return $this->dimensions; |
| 3218 | 3218 | } |
| 3219 | - public function setEnd_date( $end_date) { |
|
| 3219 | + public function setEnd_date($end_date) { |
|
| 3220 | 3220 | $this->end_date = $end_date; |
| 3221 | 3221 | } |
| 3222 | 3222 | public function getEnd_date() { |
| 3223 | 3223 | return $this->end_date; |
| 3224 | 3224 | } |
| 3225 | - public function setFilters( $filters) { |
|
| 3225 | + public function setFilters($filters) { |
|
| 3226 | 3226 | $this->filters = $filters; |
| 3227 | 3227 | } |
| 3228 | 3228 | public function getFilters() { |
| 3229 | 3229 | return $this->filters; |
| 3230 | 3230 | } |
| 3231 | - public function setIds( $ids) { |
|
| 3231 | + public function setIds($ids) { |
|
| 3232 | 3232 | $this->ids = $ids; |
| 3233 | 3233 | } |
| 3234 | 3234 | public function getIds() { |
| 3235 | 3235 | return $this->ids; |
| 3236 | 3236 | } |
| 3237 | - public function setMax_results( $max_results) { |
|
| 3237 | + public function setMax_results($max_results) { |
|
| 3238 | 3238 | $this->max_results = $max_results; |
| 3239 | 3239 | } |
| 3240 | 3240 | public function getMax_results() { |
@@ -3247,7 +3247,7 @@ discard block |
||
| 3247 | 3247 | public function getMetrics() { |
| 3248 | 3248 | return $this->metrics; |
| 3249 | 3249 | } |
| 3250 | - public function setSegment( $segment) { |
|
| 3250 | + public function setSegment($segment) { |
|
| 3251 | 3251 | $this->segment = $segment; |
| 3252 | 3252 | } |
| 3253 | 3253 | public function getSegment() { |
@@ -3260,13 +3260,13 @@ discard block |
||
| 3260 | 3260 | public function getSort() { |
| 3261 | 3261 | return $this->sort; |
| 3262 | 3262 | } |
| 3263 | - public function setStart_date( $start_date) { |
|
| 3263 | + public function setStart_date($start_date) { |
|
| 3264 | 3264 | $this->start_date = $start_date; |
| 3265 | 3265 | } |
| 3266 | 3266 | public function getStart_date() { |
| 3267 | 3267 | return $this->start_date; |
| 3268 | 3268 | } |
| 3269 | - public function setStart_index( $start_index) { |
|
| 3269 | + public function setStart_index($start_index) { |
|
| 3270 | 3270 | $this->start_index = $start_index; |
| 3271 | 3271 | } |
| 3272 | 3272 | public function getStart_index() { |
@@ -3286,7 +3286,7 @@ discard block |
||
| 3286 | 3286 | public function getConversionPathValue() { |
| 3287 | 3287 | return $this->conversionPathValue; |
| 3288 | 3288 | } |
| 3289 | - public function setPrimitiveValue( $primitiveValue) { |
|
| 3289 | + public function setPrimitiveValue($primitiveValue) { |
|
| 3290 | 3290 | $this->primitiveValue = $primitiveValue; |
| 3291 | 3291 | } |
| 3292 | 3292 | public function getPrimitiveValue() { |
@@ -3297,13 +3297,13 @@ discard block |
||
| 3297 | 3297 | class Google_McfDataRowsConversionPathValue extends Google_Model { |
| 3298 | 3298 | public $interactionType; |
| 3299 | 3299 | public $nodeValue; |
| 3300 | - public function setInteractionType( $interactionType) { |
|
| 3300 | + public function setInteractionType($interactionType) { |
|
| 3301 | 3301 | $this->interactionType = $interactionType; |
| 3302 | 3302 | } |
| 3303 | 3303 | public function getInteractionType() { |
| 3304 | 3304 | return $this->interactionType; |
| 3305 | 3305 | } |
| 3306 | - public function setNodeValue( $nodeValue) { |
|
| 3306 | + public function setNodeValue($nodeValue) { |
|
| 3307 | 3307 | $this->nodeValue = $nodeValue; |
| 3308 | 3308 | } |
| 3309 | 3309 | public function getNodeValue() { |
@@ -3339,7 +3339,7 @@ discard block |
||
| 3339 | 3339 | public $updated; |
| 3340 | 3340 | public $webPropertyId; |
| 3341 | 3341 | public $websiteUrl; |
| 3342 | - public function setAccountId( $accountId) { |
|
| 3342 | + public function setAccountId($accountId) { |
|
| 3343 | 3343 | $this->accountId = $accountId; |
| 3344 | 3344 | } |
| 3345 | 3345 | public function getAccountId() { |
@@ -3351,55 +3351,55 @@ discard block |
||
| 3351 | 3351 | public function getChildLink() { |
| 3352 | 3352 | return $this->childLink; |
| 3353 | 3353 | } |
| 3354 | - public function setCreated( $created) { |
|
| 3354 | + public function setCreated($created) { |
|
| 3355 | 3355 | $this->created = $created; |
| 3356 | 3356 | } |
| 3357 | 3357 | public function getCreated() { |
| 3358 | 3358 | return $this->created; |
| 3359 | 3359 | } |
| 3360 | - public function setCurrency( $currency) { |
|
| 3360 | + public function setCurrency($currency) { |
|
| 3361 | 3361 | $this->currency = $currency; |
| 3362 | 3362 | } |
| 3363 | 3363 | public function getCurrency() { |
| 3364 | 3364 | return $this->currency; |
| 3365 | 3365 | } |
| 3366 | - public function setDefaultPage( $defaultPage) { |
|
| 3366 | + public function setDefaultPage($defaultPage) { |
|
| 3367 | 3367 | $this->defaultPage = $defaultPage; |
| 3368 | 3368 | } |
| 3369 | 3369 | public function getDefaultPage() { |
| 3370 | 3370 | return $this->defaultPage; |
| 3371 | 3371 | } |
| 3372 | - public function setECommerceTracking( $eCommerceTracking) { |
|
| 3372 | + public function setECommerceTracking($eCommerceTracking) { |
|
| 3373 | 3373 | $this->eCommerceTracking = $eCommerceTracking; |
| 3374 | 3374 | } |
| 3375 | 3375 | public function getECommerceTracking() { |
| 3376 | 3376 | return $this->eCommerceTracking; |
| 3377 | 3377 | } |
| 3378 | - public function setExcludeQueryParameters( $excludeQueryParameters) { |
|
| 3378 | + public function setExcludeQueryParameters($excludeQueryParameters) { |
|
| 3379 | 3379 | $this->excludeQueryParameters = $excludeQueryParameters; |
| 3380 | 3380 | } |
| 3381 | 3381 | public function getExcludeQueryParameters() { |
| 3382 | 3382 | return $this->excludeQueryParameters; |
| 3383 | 3383 | } |
| 3384 | - public function setId( $id) { |
|
| 3384 | + public function setId($id) { |
|
| 3385 | 3385 | $this->id = $id; |
| 3386 | 3386 | } |
| 3387 | 3387 | public function getId() { |
| 3388 | 3388 | return $this->id; |
| 3389 | 3389 | } |
| 3390 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 3390 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 3391 | 3391 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 3392 | 3392 | } |
| 3393 | 3393 | public function getInternalWebPropertyId() { |
| 3394 | 3394 | return $this->internalWebPropertyId; |
| 3395 | 3395 | } |
| 3396 | - public function setKind( $kind) { |
|
| 3396 | + public function setKind($kind) { |
|
| 3397 | 3397 | $this->kind = $kind; |
| 3398 | 3398 | } |
| 3399 | 3399 | public function getKind() { |
| 3400 | 3400 | return $this->kind; |
| 3401 | 3401 | } |
| 3402 | - public function setName( $name) { |
|
| 3402 | + public function setName($name) { |
|
| 3403 | 3403 | $this->name = $name; |
| 3404 | 3404 | } |
| 3405 | 3405 | public function getName() { |
@@ -3417,49 +3417,49 @@ discard block |
||
| 3417 | 3417 | public function getPermissions() { |
| 3418 | 3418 | return $this->permissions; |
| 3419 | 3419 | } |
| 3420 | - public function setSelfLink( $selfLink) { |
|
| 3420 | + public function setSelfLink($selfLink) { |
|
| 3421 | 3421 | $this->selfLink = $selfLink; |
| 3422 | 3422 | } |
| 3423 | 3423 | public function getSelfLink() { |
| 3424 | 3424 | return $this->selfLink; |
| 3425 | 3425 | } |
| 3426 | - public function setSiteSearchCategoryParameters( $siteSearchCategoryParameters) { |
|
| 3426 | + public function setSiteSearchCategoryParameters($siteSearchCategoryParameters) { |
|
| 3427 | 3427 | $this->siteSearchCategoryParameters = $siteSearchCategoryParameters; |
| 3428 | 3428 | } |
| 3429 | 3429 | public function getSiteSearchCategoryParameters() { |
| 3430 | 3430 | return $this->siteSearchCategoryParameters; |
| 3431 | 3431 | } |
| 3432 | - public function setSiteSearchQueryParameters( $siteSearchQueryParameters) { |
|
| 3432 | + public function setSiteSearchQueryParameters($siteSearchQueryParameters) { |
|
| 3433 | 3433 | $this->siteSearchQueryParameters = $siteSearchQueryParameters; |
| 3434 | 3434 | } |
| 3435 | 3435 | public function getSiteSearchQueryParameters() { |
| 3436 | 3436 | return $this->siteSearchQueryParameters; |
| 3437 | 3437 | } |
| 3438 | - public function setTimezone( $timezone) { |
|
| 3438 | + public function setTimezone($timezone) { |
|
| 3439 | 3439 | $this->timezone = $timezone; |
| 3440 | 3440 | } |
| 3441 | 3441 | public function getTimezone() { |
| 3442 | 3442 | return $this->timezone; |
| 3443 | 3443 | } |
| 3444 | - public function setType( $type) { |
|
| 3444 | + public function setType($type) { |
|
| 3445 | 3445 | $this->type = $type; |
| 3446 | 3446 | } |
| 3447 | 3447 | public function getType() { |
| 3448 | 3448 | return $this->type; |
| 3449 | 3449 | } |
| 3450 | - public function setUpdated( $updated) { |
|
| 3450 | + public function setUpdated($updated) { |
|
| 3451 | 3451 | $this->updated = $updated; |
| 3452 | 3452 | } |
| 3453 | 3453 | public function getUpdated() { |
| 3454 | 3454 | return $this->updated; |
| 3455 | 3455 | } |
| 3456 | - public function setWebPropertyId( $webPropertyId) { |
|
| 3456 | + public function setWebPropertyId($webPropertyId) { |
|
| 3457 | 3457 | $this->webPropertyId = $webPropertyId; |
| 3458 | 3458 | } |
| 3459 | 3459 | public function getWebPropertyId() { |
| 3460 | 3460 | return $this->webPropertyId; |
| 3461 | 3461 | } |
| 3462 | - public function setWebsiteUrl( $websiteUrl) { |
|
| 3462 | + public function setWebsiteUrl($websiteUrl) { |
|
| 3463 | 3463 | $this->websiteUrl = $websiteUrl; |
| 3464 | 3464 | } |
| 3465 | 3465 | public function getWebsiteUrl() { |
@@ -3470,13 +3470,13 @@ discard block |
||
| 3470 | 3470 | class Google_ProfileChildLink extends Google_Model { |
| 3471 | 3471 | public $href; |
| 3472 | 3472 | public $type; |
| 3473 | - public function setHref( $href) { |
|
| 3473 | + public function setHref($href) { |
|
| 3474 | 3474 | $this->href = $href; |
| 3475 | 3475 | } |
| 3476 | 3476 | public function getHref() { |
| 3477 | 3477 | return $this->href; |
| 3478 | 3478 | } |
| 3479 | - public function setType( $type) { |
|
| 3479 | + public function setType($type) { |
|
| 3480 | 3480 | $this->type = $type; |
| 3481 | 3481 | } |
| 3482 | 3482 | public function getType() { |
@@ -3487,13 +3487,13 @@ discard block |
||
| 3487 | 3487 | class Google_ProfileParentLink extends Google_Model { |
| 3488 | 3488 | public $href; |
| 3489 | 3489 | public $type; |
| 3490 | - public function setHref( $href) { |
|
| 3490 | + public function setHref($href) { |
|
| 3491 | 3491 | $this->href = $href; |
| 3492 | 3492 | } |
| 3493 | 3493 | public function getHref() { |
| 3494 | 3494 | return $this->href; |
| 3495 | 3495 | } |
| 3496 | - public function setType( $type) { |
|
| 3496 | + public function setType($type) { |
|
| 3497 | 3497 | $this->type = $type; |
| 3498 | 3498 | } |
| 3499 | 3499 | public function getType() { |
@@ -3520,43 +3520,43 @@ discard block |
||
| 3520 | 3520 | public $kind; |
| 3521 | 3521 | public $name; |
| 3522 | 3522 | public $webPropertyId; |
| 3523 | - public function setAccountId( $accountId) { |
|
| 3523 | + public function setAccountId($accountId) { |
|
| 3524 | 3524 | $this->accountId = $accountId; |
| 3525 | 3525 | } |
| 3526 | 3526 | public function getAccountId() { |
| 3527 | 3527 | return $this->accountId; |
| 3528 | 3528 | } |
| 3529 | - public function setHref( $href) { |
|
| 3529 | + public function setHref($href) { |
|
| 3530 | 3530 | $this->href = $href; |
| 3531 | 3531 | } |
| 3532 | 3532 | public function getHref() { |
| 3533 | 3533 | return $this->href; |
| 3534 | 3534 | } |
| 3535 | - public function setId( $id) { |
|
| 3535 | + public function setId($id) { |
|
| 3536 | 3536 | $this->id = $id; |
| 3537 | 3537 | } |
| 3538 | 3538 | public function getId() { |
| 3539 | 3539 | return $this->id; |
| 3540 | 3540 | } |
| 3541 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 3541 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 3542 | 3542 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 3543 | 3543 | } |
| 3544 | 3544 | public function getInternalWebPropertyId() { |
| 3545 | 3545 | return $this->internalWebPropertyId; |
| 3546 | 3546 | } |
| 3547 | - public function setKind( $kind) { |
|
| 3547 | + public function setKind($kind) { |
|
| 3548 | 3548 | $this->kind = $kind; |
| 3549 | 3549 | } |
| 3550 | 3550 | public function getKind() { |
| 3551 | 3551 | return $this->kind; |
| 3552 | 3552 | } |
| 3553 | - public function setName( $name) { |
|
| 3553 | + public function setName($name) { |
|
| 3554 | 3554 | $this->name = $name; |
| 3555 | 3555 | } |
| 3556 | 3556 | public function getName() { |
| 3557 | 3557 | return $this->name; |
| 3558 | 3558 | } |
| 3559 | - public function setWebPropertyId( $webPropertyId) { |
|
| 3559 | + public function setWebPropertyId($webPropertyId) { |
|
| 3560 | 3560 | $this->webPropertyId = $webPropertyId; |
| 3561 | 3561 | } |
| 3562 | 3562 | public function getWebPropertyId() { |
@@ -3582,43 +3582,43 @@ discard block |
||
| 3582 | 3582 | public function getItems() { |
| 3583 | 3583 | return $this->items; |
| 3584 | 3584 | } |
| 3585 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 3585 | + public function setItemsPerPage($itemsPerPage) { |
|
| 3586 | 3586 | $this->itemsPerPage = $itemsPerPage; |
| 3587 | 3587 | } |
| 3588 | 3588 | public function getItemsPerPage() { |
| 3589 | 3589 | return $this->itemsPerPage; |
| 3590 | 3590 | } |
| 3591 | - public function setKind( $kind) { |
|
| 3591 | + public function setKind($kind) { |
|
| 3592 | 3592 | $this->kind = $kind; |
| 3593 | 3593 | } |
| 3594 | 3594 | public function getKind() { |
| 3595 | 3595 | return $this->kind; |
| 3596 | 3596 | } |
| 3597 | - public function setNextLink( $nextLink) { |
|
| 3597 | + public function setNextLink($nextLink) { |
|
| 3598 | 3598 | $this->nextLink = $nextLink; |
| 3599 | 3599 | } |
| 3600 | 3600 | public function getNextLink() { |
| 3601 | 3601 | return $this->nextLink; |
| 3602 | 3602 | } |
| 3603 | - public function setPreviousLink( $previousLink) { |
|
| 3603 | + public function setPreviousLink($previousLink) { |
|
| 3604 | 3604 | $this->previousLink = $previousLink; |
| 3605 | 3605 | } |
| 3606 | 3606 | public function getPreviousLink() { |
| 3607 | 3607 | return $this->previousLink; |
| 3608 | 3608 | } |
| 3609 | - public function setStartIndex( $startIndex) { |
|
| 3609 | + public function setStartIndex($startIndex) { |
|
| 3610 | 3610 | $this->startIndex = $startIndex; |
| 3611 | 3611 | } |
| 3612 | 3612 | public function getStartIndex() { |
| 3613 | 3613 | return $this->startIndex; |
| 3614 | 3614 | } |
| 3615 | - public function setTotalResults( $totalResults) { |
|
| 3615 | + public function setTotalResults($totalResults) { |
|
| 3616 | 3616 | $this->totalResults = $totalResults; |
| 3617 | 3617 | } |
| 3618 | 3618 | public function getTotalResults() { |
| 3619 | 3619 | return $this->totalResults; |
| 3620 | 3620 | } |
| 3621 | - public function setUsername( $username) { |
|
| 3621 | + public function setUsername($username) { |
|
| 3622 | 3622 | $this->username = $username; |
| 3623 | 3623 | } |
| 3624 | 3624 | public function getUsername() { |
@@ -3649,13 +3649,13 @@ discard block |
||
| 3649 | 3649 | public function getColumnHeaders() { |
| 3650 | 3650 | return $this->columnHeaders; |
| 3651 | 3651 | } |
| 3652 | - public function setId( $id) { |
|
| 3652 | + public function setId($id) { |
|
| 3653 | 3653 | $this->id = $id; |
| 3654 | 3654 | } |
| 3655 | 3655 | public function getId() { |
| 3656 | 3656 | return $this->id; |
| 3657 | 3657 | } |
| 3658 | - public function setKind( $kind) { |
|
| 3658 | + public function setKind($kind) { |
|
| 3659 | 3659 | $this->kind = $kind; |
| 3660 | 3660 | } |
| 3661 | 3661 | public function getKind() { |
@@ -3680,19 +3680,19 @@ discard block |
||
| 3680 | 3680 | public function getRows() { |
| 3681 | 3681 | return $this->rows; |
| 3682 | 3682 | } |
| 3683 | - public function setSelfLink( $selfLink) { |
|
| 3683 | + public function setSelfLink($selfLink) { |
|
| 3684 | 3684 | $this->selfLink = $selfLink; |
| 3685 | 3685 | } |
| 3686 | 3686 | public function getSelfLink() { |
| 3687 | 3687 | return $this->selfLink; |
| 3688 | 3688 | } |
| 3689 | - public function setTotalResults( $totalResults) { |
|
| 3689 | + public function setTotalResults($totalResults) { |
|
| 3690 | 3690 | $this->totalResults = $totalResults; |
| 3691 | 3691 | } |
| 3692 | 3692 | public function getTotalResults() { |
| 3693 | 3693 | return $this->totalResults; |
| 3694 | 3694 | } |
| 3695 | - public function setTotalsForAllResults( $totalsForAllResults) { |
|
| 3695 | + public function setTotalsForAllResults($totalsForAllResults) { |
|
| 3696 | 3696 | $this->totalsForAllResults = $totalsForAllResults; |
| 3697 | 3697 | } |
| 3698 | 3698 | public function getTotalsForAllResults() { |
@@ -3704,19 +3704,19 @@ discard block |
||
| 3704 | 3704 | public $columnType; |
| 3705 | 3705 | public $dataType; |
| 3706 | 3706 | public $name; |
| 3707 | - public function setColumnType( $columnType) { |
|
| 3707 | + public function setColumnType($columnType) { |
|
| 3708 | 3708 | $this->columnType = $columnType; |
| 3709 | 3709 | } |
| 3710 | 3710 | public function getColumnType() { |
| 3711 | 3711 | return $this->columnType; |
| 3712 | 3712 | } |
| 3713 | - public function setDataType( $dataType) { |
|
| 3713 | + public function setDataType($dataType) { |
|
| 3714 | 3714 | $this->dataType = $dataType; |
| 3715 | 3715 | } |
| 3716 | 3716 | public function getDataType() { |
| 3717 | 3717 | return $this->dataType; |
| 3718 | 3718 | } |
| 3719 | - public function setName( $name) { |
|
| 3719 | + public function setName($name) { |
|
| 3720 | 3720 | $this->name = $name; |
| 3721 | 3721 | } |
| 3722 | 3722 | public function getName() { |
@@ -3731,37 +3731,37 @@ discard block |
||
| 3731 | 3731 | public $profileName; |
| 3732 | 3732 | public $tableId; |
| 3733 | 3733 | public $webPropertyId; |
| 3734 | - public function setAccountId( $accountId) { |
|
| 3734 | + public function setAccountId($accountId) { |
|
| 3735 | 3735 | $this->accountId = $accountId; |
| 3736 | 3736 | } |
| 3737 | 3737 | public function getAccountId() { |
| 3738 | 3738 | return $this->accountId; |
| 3739 | 3739 | } |
| 3740 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 3740 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 3741 | 3741 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 3742 | 3742 | } |
| 3743 | 3743 | public function getInternalWebPropertyId() { |
| 3744 | 3744 | return $this->internalWebPropertyId; |
| 3745 | 3745 | } |
| 3746 | - public function setProfileId( $profileId) { |
|
| 3746 | + public function setProfileId($profileId) { |
|
| 3747 | 3747 | $this->profileId = $profileId; |
| 3748 | 3748 | } |
| 3749 | 3749 | public function getProfileId() { |
| 3750 | 3750 | return $this->profileId; |
| 3751 | 3751 | } |
| 3752 | - public function setProfileName( $profileName) { |
|
| 3752 | + public function setProfileName($profileName) { |
|
| 3753 | 3753 | $this->profileName = $profileName; |
| 3754 | 3754 | } |
| 3755 | 3755 | public function getProfileName() { |
| 3756 | 3756 | return $this->profileName; |
| 3757 | 3757 | } |
| 3758 | - public function setTableId( $tableId) { |
|
| 3758 | + public function setTableId($tableId) { |
|
| 3759 | 3759 | $this->tableId = $tableId; |
| 3760 | 3760 | } |
| 3761 | 3761 | public function getTableId() { |
| 3762 | 3762 | return $this->tableId; |
| 3763 | 3763 | } |
| 3764 | - public function setWebPropertyId( $webPropertyId) { |
|
| 3764 | + public function setWebPropertyId($webPropertyId) { |
|
| 3765 | 3765 | $this->webPropertyId = $webPropertyId; |
| 3766 | 3766 | } |
| 3767 | 3767 | public function getWebPropertyId() { |
@@ -3776,25 +3776,25 @@ discard block |
||
| 3776 | 3776 | public $max_results; |
| 3777 | 3777 | public $metrics; |
| 3778 | 3778 | public $sort; |
| 3779 | - public function setDimensions( $dimensions) { |
|
| 3779 | + public function setDimensions($dimensions) { |
|
| 3780 | 3780 | $this->dimensions = $dimensions; |
| 3781 | 3781 | } |
| 3782 | 3782 | public function getDimensions() { |
| 3783 | 3783 | return $this->dimensions; |
| 3784 | 3784 | } |
| 3785 | - public function setFilters( $filters) { |
|
| 3785 | + public function setFilters($filters) { |
|
| 3786 | 3786 | $this->filters = $filters; |
| 3787 | 3787 | } |
| 3788 | 3788 | public function getFilters() { |
| 3789 | 3789 | return $this->filters; |
| 3790 | 3790 | } |
| 3791 | - public function setIds( $ids) { |
|
| 3791 | + public function setIds($ids) { |
|
| 3792 | 3792 | $this->ids = $ids; |
| 3793 | 3793 | } |
| 3794 | 3794 | public function getIds() { |
| 3795 | 3795 | return $this->ids; |
| 3796 | 3796 | } |
| 3797 | - public function setMax_results( $max_results) { |
|
| 3797 | + public function setMax_results($max_results) { |
|
| 3798 | 3798 | $this->max_results = $max_results; |
| 3799 | 3799 | } |
| 3800 | 3800 | public function getMax_results() { |
@@ -3825,49 +3825,49 @@ discard block |
||
| 3825 | 3825 | public $segmentId; |
| 3826 | 3826 | public $selfLink; |
| 3827 | 3827 | public $updated; |
| 3828 | - public function setCreated( $created) { |
|
| 3828 | + public function setCreated($created) { |
|
| 3829 | 3829 | $this->created = $created; |
| 3830 | 3830 | } |
| 3831 | 3831 | public function getCreated() { |
| 3832 | 3832 | return $this->created; |
| 3833 | 3833 | } |
| 3834 | - public function setDefinition( $definition) { |
|
| 3834 | + public function setDefinition($definition) { |
|
| 3835 | 3835 | $this->definition = $definition; |
| 3836 | 3836 | } |
| 3837 | 3837 | public function getDefinition() { |
| 3838 | 3838 | return $this->definition; |
| 3839 | 3839 | } |
| 3840 | - public function setId( $id) { |
|
| 3840 | + public function setId($id) { |
|
| 3841 | 3841 | $this->id = $id; |
| 3842 | 3842 | } |
| 3843 | 3843 | public function getId() { |
| 3844 | 3844 | return $this->id; |
| 3845 | 3845 | } |
| 3846 | - public function setKind( $kind) { |
|
| 3846 | + public function setKind($kind) { |
|
| 3847 | 3847 | $this->kind = $kind; |
| 3848 | 3848 | } |
| 3849 | 3849 | public function getKind() { |
| 3850 | 3850 | return $this->kind; |
| 3851 | 3851 | } |
| 3852 | - public function setName( $name) { |
|
| 3852 | + public function setName($name) { |
|
| 3853 | 3853 | $this->name = $name; |
| 3854 | 3854 | } |
| 3855 | 3855 | public function getName() { |
| 3856 | 3856 | return $this->name; |
| 3857 | 3857 | } |
| 3858 | - public function setSegmentId( $segmentId) { |
|
| 3858 | + public function setSegmentId($segmentId) { |
|
| 3859 | 3859 | $this->segmentId = $segmentId; |
| 3860 | 3860 | } |
| 3861 | 3861 | public function getSegmentId() { |
| 3862 | 3862 | return $this->segmentId; |
| 3863 | 3863 | } |
| 3864 | - public function setSelfLink( $selfLink) { |
|
| 3864 | + public function setSelfLink($selfLink) { |
|
| 3865 | 3865 | $this->selfLink = $selfLink; |
| 3866 | 3866 | } |
| 3867 | 3867 | public function getSelfLink() { |
| 3868 | 3868 | return $this->selfLink; |
| 3869 | 3869 | } |
| 3870 | - public function setUpdated( $updated) { |
|
| 3870 | + public function setUpdated($updated) { |
|
| 3871 | 3871 | $this->updated = $updated; |
| 3872 | 3872 | } |
| 3873 | 3873 | public function getUpdated() { |
@@ -3893,43 +3893,43 @@ discard block |
||
| 3893 | 3893 | public function getItems() { |
| 3894 | 3894 | return $this->items; |
| 3895 | 3895 | } |
| 3896 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 3896 | + public function setItemsPerPage($itemsPerPage) { |
|
| 3897 | 3897 | $this->itemsPerPage = $itemsPerPage; |
| 3898 | 3898 | } |
| 3899 | 3899 | public function getItemsPerPage() { |
| 3900 | 3900 | return $this->itemsPerPage; |
| 3901 | 3901 | } |
| 3902 | - public function setKind( $kind) { |
|
| 3902 | + public function setKind($kind) { |
|
| 3903 | 3903 | $this->kind = $kind; |
| 3904 | 3904 | } |
| 3905 | 3905 | public function getKind() { |
| 3906 | 3906 | return $this->kind; |
| 3907 | 3907 | } |
| 3908 | - public function setNextLink( $nextLink) { |
|
| 3908 | + public function setNextLink($nextLink) { |
|
| 3909 | 3909 | $this->nextLink = $nextLink; |
| 3910 | 3910 | } |
| 3911 | 3911 | public function getNextLink() { |
| 3912 | 3912 | return $this->nextLink; |
| 3913 | 3913 | } |
| 3914 | - public function setPreviousLink( $previousLink) { |
|
| 3914 | + public function setPreviousLink($previousLink) { |
|
| 3915 | 3915 | $this->previousLink = $previousLink; |
| 3916 | 3916 | } |
| 3917 | 3917 | public function getPreviousLink() { |
| 3918 | 3918 | return $this->previousLink; |
| 3919 | 3919 | } |
| 3920 | - public function setStartIndex( $startIndex) { |
|
| 3920 | + public function setStartIndex($startIndex) { |
|
| 3921 | 3921 | $this->startIndex = $startIndex; |
| 3922 | 3922 | } |
| 3923 | 3923 | public function getStartIndex() { |
| 3924 | 3924 | return $this->startIndex; |
| 3925 | 3925 | } |
| 3926 | - public function setTotalResults( $totalResults) { |
|
| 3926 | + public function setTotalResults($totalResults) { |
|
| 3927 | 3927 | $this->totalResults = $totalResults; |
| 3928 | 3928 | } |
| 3929 | 3929 | public function getTotalResults() { |
| 3930 | 3930 | return $this->totalResults; |
| 3931 | 3931 | } |
| 3932 | - public function setUsername( $username) { |
|
| 3932 | + public function setUsername($username) { |
|
| 3933 | 3933 | $this->username = $username; |
| 3934 | 3934 | } |
| 3935 | 3935 | public function getUsername() { |
@@ -3944,13 +3944,13 @@ discard block |
||
| 3944 | 3944 | public $id; |
| 3945 | 3945 | public $kind; |
| 3946 | 3946 | public $status; |
| 3947 | - public function setAccountId( $accountId) { |
|
| 3947 | + public function setAccountId($accountId) { |
|
| 3948 | 3948 | $this->accountId = $accountId; |
| 3949 | 3949 | } |
| 3950 | 3950 | public function getAccountId() { |
| 3951 | 3951 | return $this->accountId; |
| 3952 | 3952 | } |
| 3953 | - public function setCustomDataSourceId( $customDataSourceId) { |
|
| 3953 | + public function setCustomDataSourceId($customDataSourceId) { |
|
| 3954 | 3954 | $this->customDataSourceId = $customDataSourceId; |
| 3955 | 3955 | } |
| 3956 | 3956 | public function getCustomDataSourceId() { |
@@ -3963,19 +3963,19 @@ discard block |
||
| 3963 | 3963 | public function getErrors() { |
| 3964 | 3964 | return $this->errors; |
| 3965 | 3965 | } |
| 3966 | - public function setId( $id) { |
|
| 3966 | + public function setId($id) { |
|
| 3967 | 3967 | $this->id = $id; |
| 3968 | 3968 | } |
| 3969 | 3969 | public function getId() { |
| 3970 | 3970 | return $this->id; |
| 3971 | 3971 | } |
| 3972 | - public function setKind( $kind) { |
|
| 3972 | + public function setKind($kind) { |
|
| 3973 | 3973 | $this->kind = $kind; |
| 3974 | 3974 | } |
| 3975 | 3975 | public function getKind() { |
| 3976 | 3976 | return $this->kind; |
| 3977 | 3977 | } |
| 3978 | - public function setStatus( $status) { |
|
| 3978 | + public function setStatus($status) { |
|
| 3979 | 3979 | $this->status = $status; |
| 3980 | 3980 | } |
| 3981 | 3981 | public function getStatus() { |
@@ -4000,37 +4000,37 @@ discard block |
||
| 4000 | 4000 | public function getItems() { |
| 4001 | 4001 | return $this->items; |
| 4002 | 4002 | } |
| 4003 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 4003 | + public function setItemsPerPage($itemsPerPage) { |
|
| 4004 | 4004 | $this->itemsPerPage = $itemsPerPage; |
| 4005 | 4005 | } |
| 4006 | 4006 | public function getItemsPerPage() { |
| 4007 | 4007 | return $this->itemsPerPage; |
| 4008 | 4008 | } |
| 4009 | - public function setKind( $kind) { |
|
| 4009 | + public function setKind($kind) { |
|
| 4010 | 4010 | $this->kind = $kind; |
| 4011 | 4011 | } |
| 4012 | 4012 | public function getKind() { |
| 4013 | 4013 | return $this->kind; |
| 4014 | 4014 | } |
| 4015 | - public function setNextLink( $nextLink) { |
|
| 4015 | + public function setNextLink($nextLink) { |
|
| 4016 | 4016 | $this->nextLink = $nextLink; |
| 4017 | 4017 | } |
| 4018 | 4018 | public function getNextLink() { |
| 4019 | 4019 | return $this->nextLink; |
| 4020 | 4020 | } |
| 4021 | - public function setPreviousLink( $previousLink) { |
|
| 4021 | + public function setPreviousLink($previousLink) { |
|
| 4022 | 4022 | $this->previousLink = $previousLink; |
| 4023 | 4023 | } |
| 4024 | 4024 | public function getPreviousLink() { |
| 4025 | 4025 | return $this->previousLink; |
| 4026 | 4026 | } |
| 4027 | - public function setStartIndex( $startIndex) { |
|
| 4027 | + public function setStartIndex($startIndex) { |
|
| 4028 | 4028 | $this->startIndex = $startIndex; |
| 4029 | 4029 | } |
| 4030 | 4030 | public function getStartIndex() { |
| 4031 | 4031 | return $this->startIndex; |
| 4032 | 4032 | } |
| 4033 | - public function setTotalResults( $totalResults) { |
|
| 4033 | + public function setTotalResults($totalResults) { |
|
| 4034 | 4034 | $this->totalResults = $totalResults; |
| 4035 | 4035 | } |
| 4036 | 4036 | public function getTotalResults() { |
@@ -4042,19 +4042,19 @@ discard block |
||
| 4042 | 4042 | public $email; |
| 4043 | 4043 | public $id; |
| 4044 | 4044 | public $kind; |
| 4045 | - public function setEmail( $email) { |
|
| 4045 | + public function setEmail($email) { |
|
| 4046 | 4046 | $this->email = $email; |
| 4047 | 4047 | } |
| 4048 | 4048 | public function getEmail() { |
| 4049 | 4049 | return $this->email; |
| 4050 | 4050 | } |
| 4051 | - public function setId( $id) { |
|
| 4051 | + public function setId($id) { |
|
| 4052 | 4052 | $this->id = $id; |
| 4053 | 4053 | } |
| 4054 | 4054 | public function getId() { |
| 4055 | 4055 | return $this->id; |
| 4056 | 4056 | } |
| 4057 | - public function setKind( $kind) { |
|
| 4057 | + public function setKind($kind) { |
|
| 4058 | 4058 | $this->kind = $kind; |
| 4059 | 4059 | } |
| 4060 | 4060 | public function getKind() { |
@@ -4069,37 +4069,37 @@ discard block |
||
| 4069 | 4069 | public $internalWebPropertyId; |
| 4070 | 4070 | public $kind; |
| 4071 | 4071 | public $name; |
| 4072 | - public function setAccountId( $accountId) { |
|
| 4072 | + public function setAccountId($accountId) { |
|
| 4073 | 4073 | $this->accountId = $accountId; |
| 4074 | 4074 | } |
| 4075 | 4075 | public function getAccountId() { |
| 4076 | 4076 | return $this->accountId; |
| 4077 | 4077 | } |
| 4078 | - public function setHref( $href) { |
|
| 4078 | + public function setHref($href) { |
|
| 4079 | 4079 | $this->href = $href; |
| 4080 | 4080 | } |
| 4081 | 4081 | public function getHref() { |
| 4082 | 4082 | return $this->href; |
| 4083 | 4083 | } |
| 4084 | - public function setId( $id) { |
|
| 4084 | + public function setId($id) { |
|
| 4085 | 4085 | $this->id = $id; |
| 4086 | 4086 | } |
| 4087 | 4087 | public function getId() { |
| 4088 | 4088 | return $this->id; |
| 4089 | 4089 | } |
| 4090 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 4090 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 4091 | 4091 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 4092 | 4092 | } |
| 4093 | 4093 | public function getInternalWebPropertyId() { |
| 4094 | 4094 | return $this->internalWebPropertyId; |
| 4095 | 4095 | } |
| 4096 | - public function setKind( $kind) { |
|
| 4096 | + public function setKind($kind) { |
|
| 4097 | 4097 | $this->kind = $kind; |
| 4098 | 4098 | } |
| 4099 | 4099 | public function getKind() { |
| 4100 | 4100 | return $this->kind; |
| 4101 | 4101 | } |
| 4102 | - public function setName( $name) { |
|
| 4102 | + public function setName($name) { |
|
| 4103 | 4103 | $this->name = $name; |
| 4104 | 4104 | } |
| 4105 | 4105 | public function getName() { |
@@ -4125,43 +4125,43 @@ discard block |
||
| 4125 | 4125 | public function getItems() { |
| 4126 | 4126 | return $this->items; |
| 4127 | 4127 | } |
| 4128 | - public function setItemsPerPage( $itemsPerPage) { |
|
| 4128 | + public function setItemsPerPage($itemsPerPage) { |
|
| 4129 | 4129 | $this->itemsPerPage = $itemsPerPage; |
| 4130 | 4130 | } |
| 4131 | 4131 | public function getItemsPerPage() { |
| 4132 | 4132 | return $this->itemsPerPage; |
| 4133 | 4133 | } |
| 4134 | - public function setKind( $kind) { |
|
| 4134 | + public function setKind($kind) { |
|
| 4135 | 4135 | $this->kind = $kind; |
| 4136 | 4136 | } |
| 4137 | 4137 | public function getKind() { |
| 4138 | 4138 | return $this->kind; |
| 4139 | 4139 | } |
| 4140 | - public function setNextLink( $nextLink) { |
|
| 4140 | + public function setNextLink($nextLink) { |
|
| 4141 | 4141 | $this->nextLink = $nextLink; |
| 4142 | 4142 | } |
| 4143 | 4143 | public function getNextLink() { |
| 4144 | 4144 | return $this->nextLink; |
| 4145 | 4145 | } |
| 4146 | - public function setPreviousLink( $previousLink) { |
|
| 4146 | + public function setPreviousLink($previousLink) { |
|
| 4147 | 4147 | $this->previousLink = $previousLink; |
| 4148 | 4148 | } |
| 4149 | 4149 | public function getPreviousLink() { |
| 4150 | 4150 | return $this->previousLink; |
| 4151 | 4151 | } |
| 4152 | - public function setStartIndex( $startIndex) { |
|
| 4152 | + public function setStartIndex($startIndex) { |
|
| 4153 | 4153 | $this->startIndex = $startIndex; |
| 4154 | 4154 | } |
| 4155 | 4155 | public function getStartIndex() { |
| 4156 | 4156 | return $this->startIndex; |
| 4157 | 4157 | } |
| 4158 | - public function setTotalResults( $totalResults) { |
|
| 4158 | + public function setTotalResults($totalResults) { |
|
| 4159 | 4159 | $this->totalResults = $totalResults; |
| 4160 | 4160 | } |
| 4161 | 4161 | public function getTotalResults() { |
| 4162 | 4162 | return $this->totalResults; |
| 4163 | 4163 | } |
| 4164 | - public function setUsername( $username) { |
|
| 4164 | + public function setUsername($username) { |
|
| 4165 | 4165 | $this->username = $username; |
| 4166 | 4166 | } |
| 4167 | 4167 | public function getUsername() { |
@@ -4192,7 +4192,7 @@ discard block |
||
| 4192 | 4192 | public $selfLink; |
| 4193 | 4193 | public $updated; |
| 4194 | 4194 | public $websiteUrl; |
| 4195 | - public function setAccountId( $accountId) { |
|
| 4195 | + public function setAccountId($accountId) { |
|
| 4196 | 4196 | $this->accountId = $accountId; |
| 4197 | 4197 | } |
| 4198 | 4198 | public function getAccountId() { |
@@ -4204,49 +4204,49 @@ discard block |
||
| 4204 | 4204 | public function getChildLink() { |
| 4205 | 4205 | return $this->childLink; |
| 4206 | 4206 | } |
| 4207 | - public function setCreated( $created) { |
|
| 4207 | + public function setCreated($created) { |
|
| 4208 | 4208 | $this->created = $created; |
| 4209 | 4209 | } |
| 4210 | 4210 | public function getCreated() { |
| 4211 | 4211 | return $this->created; |
| 4212 | 4212 | } |
| 4213 | - public function setDefaultProfileId( $defaultProfileId) { |
|
| 4213 | + public function setDefaultProfileId($defaultProfileId) { |
|
| 4214 | 4214 | $this->defaultProfileId = $defaultProfileId; |
| 4215 | 4215 | } |
| 4216 | 4216 | public function getDefaultProfileId() { |
| 4217 | 4217 | return $this->defaultProfileId; |
| 4218 | 4218 | } |
| 4219 | - public function setId( $id) { |
|
| 4219 | + public function setId($id) { |
|
| 4220 | 4220 | $this->id = $id; |
| 4221 | 4221 | } |
| 4222 | 4222 | public function getId() { |
| 4223 | 4223 | return $this->id; |
| 4224 | 4224 | } |
| 4225 | - public function setIndustryVertical( $industryVertical) { |
|
| 4225 | + public function setIndustryVertical($industryVertical) { |
|
| 4226 | 4226 | $this->industryVertical = $industryVertical; |
| 4227 | 4227 | } |
| 4228 | 4228 | public function getIndustryVertical() { |
| 4229 | 4229 | return $this->industryVertical; |
| 4230 | 4230 | } |
| 4231 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
| 4231 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
| 4232 | 4232 | $this->internalWebPropertyId = $internalWebPropertyId; |
| 4233 | 4233 | } |
| 4234 | 4234 | public function getInternalWebPropertyId() { |
| 4235 | 4235 | return $this->internalWebPropertyId; |
| 4236 | 4236 | } |
| 4237 | - public function setKind( $kind) { |
|
| 4237 | + public function setKind($kind) { |
|
| 4238 | 4238 | $this->kind = $kind; |
| 4239 | 4239 | } |
| 4240 | 4240 | public function getKind() { |
| 4241 | 4241 | return $this->kind; |
| 4242 | 4242 | } |
| 4243 | - public function setLevel( $level) { |
|
| 4243 | + public function setLevel($level) { |
|
| 4244 | 4244 | $this->level = $level; |
| 4245 | 4245 | } |
| 4246 | 4246 | public function getLevel() { |
| 4247 | 4247 | return $this->level; |
| 4248 | 4248 | } |
| 4249 | - public function setName( $name) { |
|
| 4249 | + public function setName($name) { |
|
| 4250 | 4250 | $this->name = $name; |
| 4251 | 4251 | } |
| 4252 | 4252 | public function getName() { |
@@ -4264,25 +4264,25 @@ discard block |
||
| 4264 | 4264 | public function getPermissions() { |
| 4265 | 4265 | return $this->permissions; |
| 4266 | 4266 | } |
| 4267 | - public function setProfileCount( $profileCount) { |
|
| 4267 | + public function setProfileCount($profileCount) { |
|
| 4268 | 4268 | $this->profileCount = $profileCount; |
| 4269 | 4269 | } |
| 4270 | 4270 | public function getProfileCount() { |
| 4271 | 4271 | return $this->profileCount; |
| 4272 | 4272 | } |
| 4273 | - public function setSelfLink( $selfLink) { |
|
| 4273 | + public function setSelfLink($selfLink) { |
|
| 4274 | 4274 | $this->selfLink = $selfLink; |
| 4275 | 4275 | } |
| 4276 | 4276 | public function getSelfLink() { |
| 4277 | 4277 | return $this->selfLink; |
| 4278 | 4278 | } |
| 4279 | - public function setUpdated( $updated) { |
|
| 4279 | + public function setUpdated($updated) { |
|
| 4280 | 4280 | $this->updated = $updated; |
| 4281 | 4281 | } |
| 4282 | 4282 | public function getUpdated() { |
| 4283 | 4283 | return $this->updated; |
| 4284 | 4284 | } |
| 4285 | - public function setWebsiteUrl( $websiteUrl) { |
|
| 4285 | + public function setWebsiteUrl($websiteUrl) { |
|
| 4286 | 4286 | $this->websiteUrl = $websiteUrl; |
| 4287 | 4287 | } |
| 4288 | 4288 | public function getWebsiteUrl() { |
@@ -4293,13 +4293,13 @@ discard block |
||
| 4293 | 4293 | class Google_WebpropertyChildLink extends Google_Model { |
| 4294 | 4294 | public $href; |
| 4295 | 4295 | public $type; |
| 4296 | - public function setHref( $href) { |
|
| 4296 | + public function setHref($href) { |
|
| 4297 | 4297 | $this->href = $href; |
| 4298 | 4298 | } |
| 4299 | 4299 | public function getHref() { |
| 4300 | 4300 | return $this->href; |
| 4301 | 4301 | } |
| 4302 | - public function setType( $type) { |
|
| 4302 | + public function setType($type) { |
|
| 4303 | 4303 | $this->type = $type; |
| 4304 | 4304 | } |
| 4305 | 4305 | public function getType() { |
@@ -4310,13 +4310,13 @@ discard block |
||
| 4310 | 4310 | class Google_WebpropertyParentLink extends Google_Model { |
| 4311 | 4311 | public $href; |
| 4312 | 4312 | public $type; |
| 4313 | - public function setHref( $href) { |
|
| 4313 | + public function setHref($href) { |
|
| 4314 | 4314 | $this->href = $href; |
| 4315 | 4315 | } |
| 4316 | 4316 | public function getHref() { |
| 4317 | 4317 | return $this->href; |
| 4318 | 4318 | } |
| 4319 | - public function setType( $type) { |
|
| 4319 | + public function setType($type) { |
|
| 4320 | 4320 | $this->type = $type; |
| 4321 | 4321 | } |
| 4322 | 4322 | public function getType() { |