@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | , $connection["db_password"] |
| 52 | 52 | , $connection["db_database"] |
| 53 | 53 | , $connection["db_port"]); |
| 54 | - } |
|
| 55 | - else |
|
| 54 | + } else |
|
| 56 | 55 | { |
| 57 | 56 | $result = @mysqli_connect($connection["db_hostname"] |
| 58 | 57 | , $connection["db_userid"] |
@@ -209,8 +208,7 @@ discard block |
||
| 209 | 208 | $params[] = $v; |
| 210 | 209 | $types .= $type; |
| 211 | 210 | } |
| 212 | - } |
|
| 213 | - else |
|
| 211 | + } else |
|
| 214 | 212 | { |
| 215 | 213 | $params[] = $value; |
| 216 | 214 | $types .= $type; |
@@ -249,10 +247,12 @@ discard block |
||
| 249 | 247 | $longtext_exists = false; |
| 250 | 248 | foreach($fields as $field) |
| 251 | 249 | { |
| 252 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 250 | + if(isset($resultArray[$field->name])) { |
|
| 251 | + // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 253 | 252 | { |
| 254 | 253 | $field->name = 'repeat_' . $field->name; |
| 255 | 254 | } |
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | // Array passed needs to contain references, not values |
| 258 | 258 | $row[$field->name] = ""; |
@@ -301,8 +301,7 @@ discard block |
||
| 301 | 301 | { |
| 302 | 302 | $output[$arrayIndexEndValue--] = $row; |
| 303 | 303 | } |
| 304 | - } |
|
| 305 | - else |
|
| 304 | + } else |
|
| 306 | 305 | { |
| 307 | 306 | $output = $rows; |
| 308 | 307 | } |
@@ -312,8 +311,7 @@ discard block |
||
| 312 | 311 | if(isset($arrayIndexEndValue)) |
| 313 | 312 | { |
| 314 | 313 | return $output; |
| 315 | - } |
|
| 316 | - else |
|
| 314 | + } else |
|
| 317 | 315 | { |
| 318 | 316 | return $output[0]; |
| 319 | 317 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * Search Result |
| 32 | 32 | * |
| 33 | - * @return Object |
|
| 33 | + * @return Object|null |
|
| 34 | 34 | */ |
| 35 | 35 | function IS() |
| 36 | 36 | { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | function __connect($connection) |
| 45 | 45 | { |
| 46 | 46 | // Attempt to connect |
| 47 | - if($connection["db_port"]) |
|
| 47 | + if ($connection["db_port"]) |
|
| 48 | 48 | { |
| 49 | 49 | $result = @mysqli_connect($connection["db_hostname"] |
| 50 | 50 | , $connection["db_userid"] |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | , $connection["db_database"]); |
| 61 | 61 | } |
| 62 | 62 | $error = mysqli_connect_errno(); |
| 63 | - if($error) |
|
| 63 | + if ($error) |
|
| 64 | 64 | { |
| 65 | 65 | $this->setError($error, mysqli_connect_error()); |
| 66 | 66 | return; |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | function addQuotes($string) |
| 89 | 89 | { |
| 90 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 90 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 91 | 91 | { |
| 92 | 92 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
| 93 | 93 | } |
| 94 | - if(!is_numeric($string)) |
|
| 94 | + if (!is_numeric($string)) |
|
| 95 | 95 | { |
| 96 | 96 | $connection = $this->_getConnection('master'); |
| 97 | 97 | $string = mysqli_escape_string($connection, $string); |
@@ -108,23 +108,23 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | function __query($query, $connection) |
| 110 | 110 | { |
| 111 | - if($this->use_prepared_statements == 'Y') |
|
| 111 | + if ($this->use_prepared_statements == 'Y') |
|
| 112 | 112 | { |
| 113 | 113 | // 1. Prepare query |
| 114 | 114 | $stmt = mysqli_prepare($connection, $query); |
| 115 | - if($stmt) |
|
| 115 | + if ($stmt) |
|
| 116 | 116 | { |
| 117 | 117 | $types = ''; |
| 118 | 118 | $params = array(); |
| 119 | 119 | $this->_prepareQueryParameters($types, $params); |
| 120 | 120 | |
| 121 | - if(!empty($params)) |
|
| 121 | + if (!empty($params)) |
|
| 122 | 122 | { |
| 123 | 123 | $args[0] = $stmt; |
| 124 | 124 | $args[1] = $types; |
| 125 | 125 | |
| 126 | 126 | $i = 2; |
| 127 | - foreach($params as $key => $param) |
|
| 127 | + foreach ($params as $key => $param) |
|
| 128 | 128 | { |
| 129 | 129 | $copy[$key] = $param; |
| 130 | 130 | $args[$i++] = &$copy[$key]; |
@@ -132,18 +132,18 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | // 2. Bind parameters |
| 134 | 134 | $status = call_user_func_array('mysqli_stmt_bind_param', $args); |
| 135 | - if(!$status) |
|
| 135 | + if (!$status) |
|
| 136 | 136 | { |
| 137 | - $this->setError(-1, "Invalid arguments: $query" . mysqli_error($connection) . PHP_EOL . print_r($args, true)); |
|
| 137 | + $this->setError(-1, "Invalid arguments: $query".mysqli_error($connection).PHP_EOL.print_r($args, true)); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // 3. Execute query |
| 142 | 142 | $status = mysqli_stmt_execute($stmt); |
| 143 | 143 | |
| 144 | - if(!$status) |
|
| 144 | + if (!$status) |
|
| 145 | 145 | { |
| 146 | - $this->setError(-1, "Prepared statement failed: $query" . mysqli_error($connection) . PHP_EOL . print_r($args, true)); |
|
| 146 | + $this->setError(-1, "Prepared statement failed: $query".mysqli_error($connection).PHP_EOL.print_r($args, true)); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // Return stmt for other processing - like retrieving resultset (_fetch) |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $result = mysqli_query($connection, $query); |
| 156 | 156 | // Error Check |
| 157 | 157 | $error = mysqli_error($connection); |
| 158 | - if($error) |
|
| 158 | + if ($error) |
|
| 159 | 159 | { |
| 160 | 160 | $this->setError(mysqli_errno($connection), $error); |
| 161 | 161 | } |
@@ -174,23 +174,23 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $types = ''; |
| 176 | 176 | $params = array(); |
| 177 | - if(!$this->param) |
|
| 177 | + if (!$this->param) |
|
| 178 | 178 | { |
| 179 | 179 | return; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - foreach($this->param as $k => $o) |
|
| 182 | + foreach ($this->param as $k => $o) |
|
| 183 | 183 | { |
| 184 | 184 | $value = $o->getUnescapedValue(); |
| 185 | 185 | $type = $o->getType(); |
| 186 | 186 | |
| 187 | 187 | // Skip column names -> this should be concatenated to query string |
| 188 | - if($o->isColumnName()) |
|
| 188 | + if ($o->isColumnName()) |
|
| 189 | 189 | { |
| 190 | 190 | continue; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - switch($type) |
|
| 193 | + switch ($type) |
|
| 194 | 194 | { |
| 195 | 195 | case 'number' : |
| 196 | 196 | $type = 'i'; |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | $type = 's'; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - if(is_array($value)) |
|
| 205 | + if (is_array($value)) |
|
| 206 | 206 | { |
| 207 | - foreach($value as $v) |
|
| 207 | + foreach ($value as $v) |
|
| 208 | 208 | { |
| 209 | 209 | $params[] = $v; |
| 210 | 210 | $types .= $type; |
@@ -226,12 +226,12 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | function _fetch($result, $arrayIndexEndValue = NULL) |
| 228 | 228 | { |
| 229 | - if($this->use_prepared_statements != 'Y') |
|
| 229 | + if ($this->use_prepared_statements != 'Y') |
|
| 230 | 230 | { |
| 231 | 231 | return parent::_fetch($result, $arrayIndexEndValue); |
| 232 | 232 | } |
| 233 | 233 | $output = array(); |
| 234 | - if(!$this->isConnected() || $this->isError() || !$result) |
|
| 234 | + if (!$this->isConnected() || $this->isError() || !$result) |
|
| 235 | 235 | { |
| 236 | 236 | return $output; |
| 237 | 237 | } |
@@ -247,25 +247,25 @@ discard block |
||
| 247 | 247 | * MYSQLI_TYPE for longtext is 252 |
| 248 | 248 | */ |
| 249 | 249 | $longtext_exists = false; |
| 250 | - foreach($fields as $field) |
|
| 250 | + foreach ($fields as $field) |
|
| 251 | 251 | { |
| 252 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 252 | + if (isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 253 | 253 | { |
| 254 | - $field->name = 'repeat_' . $field->name; |
|
| 254 | + $field->name = 'repeat_'.$field->name; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | // Array passed needs to contain references, not values |
| 258 | 258 | $row[$field->name] = ""; |
| 259 | 259 | $resultArray[$field->name] = &$row[$field->name]; |
| 260 | 260 | |
| 261 | - if($field->type == 252) |
|
| 261 | + if ($field->type == 252) |
|
| 262 | 262 | { |
| 263 | 263 | $longtext_exists = true; |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | $resultArray = array_merge(array($stmt), $resultArray); |
| 267 | 267 | |
| 268 | - if($longtext_exists) |
|
| 268 | + if ($longtext_exists) |
|
| 269 | 269 | { |
| 270 | 270 | mysqli_stmt_store_result($stmt); |
| 271 | 271 | } |
@@ -273,17 +273,17 @@ discard block |
||
| 273 | 273 | call_user_func_array('mysqli_stmt_bind_result', $resultArray); |
| 274 | 274 | |
| 275 | 275 | $rows = array(); |
| 276 | - while(mysqli_stmt_fetch($stmt)) |
|
| 276 | + while (mysqli_stmt_fetch($stmt)) |
|
| 277 | 277 | { |
| 278 | 278 | $resultObject = new stdClass(); |
| 279 | 279 | |
| 280 | - foreach($resultArray as $key => $value) |
|
| 280 | + foreach ($resultArray as $key => $value) |
|
| 281 | 281 | { |
| 282 | - if($key === 0) |
|
| 282 | + if ($key === 0) |
|
| 283 | 283 | { |
| 284 | 284 | continue; // Skip stmt object |
| 285 | 285 | } |
| 286 | - if(strpos($key, 'repeat_')) |
|
| 286 | + if (strpos($key, 'repeat_')) |
|
| 287 | 287 | { |
| 288 | 288 | $key = substr($key, 6); |
| 289 | 289 | } |
@@ -295,9 +295,9 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | mysqli_stmt_close($stmt); |
| 297 | 297 | |
| 298 | - if($arrayIndexEndValue) |
|
| 298 | + if ($arrayIndexEndValue) |
|
| 299 | 299 | { |
| 300 | - foreach($rows as $row) |
|
| 300 | + foreach ($rows as $row) |
|
| 301 | 301 | { |
| 302 | 302 | $output[$arrayIndexEndValue--] = $row; |
| 303 | 303 | } |
@@ -307,9 +307,9 @@ discard block |
||
| 307 | 307 | $output = $rows; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - if(count($output) == 1) |
|
| 310 | + if (count($output) == 1) |
|
| 311 | 311 | { |
| 312 | - if(isset($arrayIndexEndValue)) |
|
| 312 | + if (isset($arrayIndexEndValue)) |
|
| 313 | 313 | { |
| 314 | 314 | return $output; |
| 315 | 315 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | function _executeInsertAct($queryObject, $with_values = false) |
| 332 | 332 | { |
| 333 | - if($this->use_prepared_statements != 'Y') |
|
| 333 | + if ($this->use_prepared_statements != 'Y') |
|
| 334 | 334 | { |
| 335 | 335 | return parent::_executeInsertAct($queryObject); |
| 336 | 336 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | function _executeUpdateAct($queryObject, $with_values = false) |
| 350 | 350 | { |
| 351 | - if($this->use_prepared_statements != 'Y') |
|
| 351 | + if ($this->use_prepared_statements != 'Y') |
|
| 352 | 352 | { |
| 353 | 353 | return parent::_executeUpdateAct($queryObject); |
| 354 | 354 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | function _executeDeleteAct($queryObject, $with_values = false) |
| 368 | 368 | { |
| 369 | - if($this->use_prepared_statements != 'Y') |
|
| 369 | + if ($this->use_prepared_statements != 'Y') |
|
| 370 | 370 | { |
| 371 | 371 | return parent::_executeDeleteAct($queryObject); |
| 372 | 372 | } |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | */ |
| 388 | 388 | function _executeSelectAct($queryObject, $connection = null, $with_values = false) |
| 389 | 389 | { |
| 390 | - if($this->use_prepared_statements != 'Y') |
|
| 390 | + if ($this->use_prepared_statements != 'Y') |
|
| 391 | 391 | { |
| 392 | 392 | return parent::_executeSelectAct($queryObject, $connection); |
| 393 | 393 | } |
@@ -30,8 +30,9 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | function getArgument() |
| 32 | 32 | {
|
| 33 | - if(!$this->show()) |
|
| 34 | - return; |
|
| 33 | + if(!$this->show()) { |
|
| 34 | + return; |
|
| 35 | + } |
|
| 35 | 36 | return $this->argument; |
| 36 | 37 | } |
| 37 | 38 | |
@@ -55,15 +56,13 @@ discard block |
||
| 55 | 56 | $q = substr($q, 0, -1); |
| 56 | 57 | } |
| 57 | 58 | $q = '(' . $q . ')';
|
| 58 | - } |
|
| 59 | - else |
|
| 59 | + } else |
|
| 60 | 60 | {
|
| 61 | 61 | // Prepared statements: column names should not be sent as query arguments, but instead concatenated to query string |
| 62 | 62 | if($this->argument->isColumnName()) |
| 63 | 63 | {
|
| 64 | 64 | $q = $value; |
| 65 | - } |
|
| 66 | - else |
|
| 65 | + } else |
|
| 67 | 66 | {
|
| 68 | 67 | $q = '?'; |
| 69 | 68 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | function ConditionWithArgument($column_name, $argument, $operation, $pipe = "") |
| 21 | 21 | {
|
| 22 | - if($argument === null) |
|
| 22 | + if ($argument === null) |
|
| 23 | 23 | {
|
| 24 | 24 | $this->_show = false; |
| 25 | 25 | return; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | function getArgument() |
| 32 | 32 | {
|
| 33 | - if(!$this->show()) |
|
| 33 | + if (!$this->show()) |
|
| 34 | 34 | return; |
| 35 | 35 | return $this->argument; |
| 36 | 36 | } |
@@ -43,23 +43,23 @@ discard block |
||
| 43 | 43 | {
|
| 44 | 44 | $value = $this->argument->getUnescapedValue(); |
| 45 | 45 | |
| 46 | - if(is_array($value)) |
|
| 46 | + if (is_array($value)) |
|
| 47 | 47 | {
|
| 48 | 48 | $q = ''; |
| 49 | - foreach($value as $v) |
|
| 49 | + foreach ($value as $v) |
|
| 50 | 50 | {
|
| 51 | 51 | $q .= '?,'; |
| 52 | 52 | } |
| 53 | - if($q !== '') |
|
| 53 | + if ($q !== '') |
|
| 54 | 54 | {
|
| 55 | 55 | $q = substr($q, 0, -1); |
| 56 | 56 | } |
| 57 | - $q = '(' . $q . ')';
|
|
| 57 | + $q = '('.$q.')';
|
|
| 58 | 58 | } |
| 59 | 59 | else |
| 60 | 60 | {
|
| 61 | 61 | // Prepared statements: column names should not be sent as query arguments, but instead concatenated to query string |
| 62 | - if($this->argument->isColumnName()) |
|
| 62 | + if ($this->argument->isColumnName()) |
|
| 63 | 63 | {
|
| 64 | 64 | $q = $value; |
| 65 | 65 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $q = '?'; |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | - return $this->pipe . ' ' . $this->getConditionPart($q); |
|
| 71 | + return $this->pipe.' '.$this->getConditionPart($q); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -76,17 +76,17 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function show() |
| 78 | 78 | {
|
| 79 | - if(!isset($this->_show)) |
|
| 79 | + if (!isset($this->_show)) |
|
| 80 | 80 | {
|
| 81 | - if(!$this->argument->isValid()) |
|
| 81 | + if (!$this->argument->isValid()) |
|
| 82 | 82 | {
|
| 83 | 83 | $this->_show = false; |
| 84 | 84 | } |
| 85 | - if($this->_value === '\'\'') |
|
| 85 | + if ($this->_value === '\'\'') |
|
| 86 | 86 | {
|
| 87 | 87 | $this->_show = false; |
| 88 | 88 | } |
| 89 | - if(!isset($this->_show)) |
|
| 89 | + if (!isset($this->_show)) |
|
| 90 | 90 | {
|
| 91 | 91 | return parent::show(); |
| 92 | 92 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | {
|
| 28 | 28 | parent::SelectExpression($column_name, $alias); |
| 29 | 29 | |
| 30 | - if(!is_bool($click_count)) |
|
| 30 | + if (!is_bool($click_count)) |
|
| 31 | 31 | {
|
| 32 | 32 | // error_log("Click_count value for $column_name was not boolean", 0);
|
| 33 | 33 | $this->click_count = false; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | function getExpression() |
| 48 | 48 | {
|
| 49 | 49 | $db_type = Context::getDBType(); |
| 50 | - if($db_type == 'cubrid') |
|
| 50 | + if ($db_type == 'cubrid') |
|
| 51 | 51 | {
|
| 52 | 52 | return "INCR($this->column_name)"; |
| 53 | 53 | } |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | if($this->limit) |
| 112 | 112 | {
|
| 113 | 113 | return $this->limit->toString(); |
| 114 | - } |
|
| 115 | - else |
|
| 114 | + } else |
|
| 116 | 115 | {
|
| 117 | 116 | return ""; |
| 118 | 117 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | function getValue($with_values = true) |
| 33 | 33 | {
|
| 34 | - if($with_values) |
|
| 34 | + if ($with_values) |
|
| 35 | 35 | {
|
| 36 | 36 | return $this->argument->getValue(); |
| 37 | 37 | } |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | function show() |
| 42 | 42 | {
|
| 43 | - if(!$this->argument) |
|
| 43 | + if (!$this->argument) |
|
| 44 | 44 | {
|
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | $value = $this->argument->getValue(); |
| 48 | - if(!isset($value)) |
|
| 48 | + if (!isset($value)) |
|
| 49 | 49 | {
|
| 50 | 50 | return false; |
| 51 | 51 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | function getArguments() |
| 61 | 61 | {
|
| 62 | - if($this->argument) |
|
| 62 | + if ($this->argument) |
|
| 63 | 63 | {
|
| 64 | 64 | return array($this->argument); |
| 65 | 65 | } |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | if($this->limit) |
| 112 | 112 | {
|
| 113 | 113 | return $this->limit->toString(); |
| 114 | - } |
|
| 115 | - else |
|
| 114 | + } else |
|
| 116 | 115 | {
|
| 117 | 116 | return ""; |
| 118 | 117 | } |
@@ -59,11 +59,11 @@ |
||
| 59 | 59 | function getArguments() |
| 60 | 60 | {
|
| 61 | 61 | $args = array(); |
| 62 | - if(is_a($this->column_name, 'Argument')) |
|
| 62 | + if (is_a($this->column_name, 'Argument')) |
|
| 63 | 63 | {
|
| 64 | 64 | $args[] = $this->column_name; |
| 65 | 65 | } |
| 66 | - if(is_a($this->sort_order, 'Argument')) |
|
| 66 | + if (is_a($this->sort_order, 'Argument')) |
|
| 67 | 67 | {
|
| 68 | 68 | $args[] = $this->sort_order; |
| 69 | 69 | } |
@@ -53,12 +53,10 @@ |
||
| 53 | 53 | if($index_hint_type == 'USE') |
| 54 | 54 | {
|
| 55 | 55 | $use_index_hint .= $index_hint->getIndexName() . ', '; |
| 56 | - } |
|
| 57 | - else if($index_hint_type == 'FORCE') |
|
| 56 | + } else if($index_hint_type == 'FORCE') |
|
| 58 | 57 | {
|
| 59 | 58 | $force_index_hint .= $index_hint->getIndexName() . ', '; |
| 60 | - } |
|
| 61 | - else if($index_hint_type == 'IGNORE') |
|
| 59 | + } else if($index_hint_type == 'IGNORE') |
|
| 62 | 60 | {
|
| 63 | 61 | $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
| 64 | 62 | } |
@@ -47,33 +47,33 @@ |
||
| 47 | 47 | $use_index_hint = ''; |
| 48 | 48 | $force_index_hint = ''; |
| 49 | 49 | $ignore_index_hint = ''; |
| 50 | - foreach($this->index_hints_list as $index_hint) |
|
| 50 | + foreach ($this->index_hints_list as $index_hint) |
|
| 51 | 51 | {
|
| 52 | 52 | $index_hint_type = $index_hint->getIndexHintType(); |
| 53 | - if($index_hint_type == 'USE') |
|
| 53 | + if ($index_hint_type == 'USE') |
|
| 54 | 54 | {
|
| 55 | - $use_index_hint .= $index_hint->getIndexName() . ', '; |
|
| 55 | + $use_index_hint .= $index_hint->getIndexName().', '; |
|
| 56 | 56 | } |
| 57 | - else if($index_hint_type == 'FORCE') |
|
| 57 | + else if ($index_hint_type == 'FORCE') |
|
| 58 | 58 | {
|
| 59 | - $force_index_hint .= $index_hint->getIndexName() . ', '; |
|
| 59 | + $force_index_hint .= $index_hint->getIndexName().', '; |
|
| 60 | 60 | } |
| 61 | - else if($index_hint_type == 'IGNORE') |
|
| 61 | + else if ($index_hint_type == 'IGNORE') |
|
| 62 | 62 | {
|
| 63 | - $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
|
| 63 | + $ignore_index_hint .= $index_hint->getIndexName().', '; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | - if($use_index_hint != '') |
|
| 66 | + if ($use_index_hint != '') |
|
| 67 | 67 | {
|
| 68 | - $result .= ' USE INDEX (' . substr($use_index_hint, 0, -2) . ') ';
|
|
| 68 | + $result .= ' USE INDEX ('.substr($use_index_hint, 0, -2).') ';
|
|
| 69 | 69 | } |
| 70 | - if($force_index_hint != '') |
|
| 70 | + if ($force_index_hint != '') |
|
| 71 | 71 | {
|
| 72 | - $result .= ' FORCE INDEX (' . substr($force_index_hint, 0, -2) . ') ';
|
|
| 72 | + $result .= ' FORCE INDEX ('.substr($force_index_hint, 0, -2).') ';
|
|
| 73 | 73 | } |
| 74 | - if($ignore_index_hint != '') |
|
| 74 | + if ($ignore_index_hint != '') |
|
| 75 | 75 | {
|
| 76 | - $result .= ' IGNORE INDEX (' . substr($ignore_index_hint, 0, -2) . ') ';
|
|
| 76 | + $result .= ' IGNORE INDEX ('.substr($ignore_index_hint, 0, -2).') ';
|
|
| 77 | 77 | } |
| 78 | 78 | return $result; |
| 79 | 79 | } |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | if($oModule->module_info->module == $oModule->module) |
| 24 | 24 | { |
| 25 | 25 | $skin = $oModule->origin_module_info->skin; |
| 26 | - } |
|
| 27 | - else |
|
| 26 | + } else |
|
| 28 | 27 | { |
| 29 | 28 | $skin = $oModule->module_config->skin; |
| 30 | 29 | } |
@@ -44,13 +43,11 @@ discard block |
||
| 44 | 43 | $template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); |
| 45 | 44 | } |
| 46 | 45 | } |
| 47 | - } |
|
| 48 | - else |
|
| 46 | + } else |
|
| 49 | 47 | { |
| 50 | 48 | $template_path = $oModule->getTemplatePath(); |
| 51 | 49 | } |
| 52 | - } |
|
| 53 | - else |
|
| 50 | + } else |
|
| 54 | 51 | { |
| 55 | 52 | $template_path = $oModule->getTemplatePath(); |
| 56 | 53 | } |
@@ -228,8 +225,7 @@ discard block |
||
| 228 | 225 | { |
| 229 | 226 | $this->_loadMobileJSCSS(); |
| 230 | 227 | $output = $oTemplate->compile('./common/tpl', 'mobile_layout'); |
| 231 | - } |
|
| 232 | - else |
|
| 228 | + } else |
|
| 233 | 229 | { |
| 234 | 230 | $this->_loadJSCSS(); |
| 235 | 231 | $output = $oTemplate->compile('./common/tpl', 'common_layout'); |
@@ -402,8 +398,7 @@ discard block |
||
| 402 | 398 | $oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true); |
| 403 | 399 | $oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true); |
| 404 | 400 | $oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true); |
| 405 | - } |
|
| 406 | - else |
|
| 401 | + } else |
|
| 407 | 402 | { |
| 408 | 403 | $oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true); |
| 409 | 404 | $oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true); |
@@ -424,8 +419,7 @@ discard block |
||
| 424 | 419 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true); |
| 425 | 420 | $oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true); |
| 426 | 421 | $oContext->loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true); |
| 427 | - } |
|
| 428 | - else |
|
| 422 | + } else |
|
| 429 | 423 | { |
| 430 | 424 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true); |
| 431 | 425 | $oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
@@ -458,8 +452,7 @@ discard block |
||
| 458 | 452 | $oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true); |
| 459 | 453 | $oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true); |
| 460 | 454 | $oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true); |
| 461 | - } |
|
| 462 | - else |
|
| 455 | + } else |
|
| 463 | 456 | { |
| 464 | 457 | $oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true); |
| 465 | 458 | $oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * get layout setting view. |
| 19 | - * @return void |
|
| 19 | + * @return string|null |
|
| 20 | 20 | */ |
| 21 | 21 | public function getLayoutAdminSetInfoView() |
| 22 | 22 | { |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $template_path = $oModule->getTemplatePath(); |
| 20 | 20 | |
| 21 | - if(!is_dir($template_path)) |
|
| 21 | + if (!is_dir($template_path)) |
|
| 22 | 22 | { |
| 23 | - if($oModule->module_info->module == $oModule->module) |
|
| 23 | + if ($oModule->module_info->module == $oModule->module) |
|
| 24 | 24 | { |
| 25 | 25 | $skin = $oModule->origin_module_info->skin; |
| 26 | 26 | } |
@@ -29,17 +29,17 @@ discard block |
||
| 29 | 29 | $skin = $oModule->module_config->skin; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
|
| 32 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
|
| 33 | 33 | { |
| 34 | - if($skin && is_string($skin)) |
|
| 34 | + if ($skin && is_string($skin)) |
|
| 35 | 35 | { |
| 36 | 36 | $theme_skin = explode('|@|', $skin); |
| 37 | 37 | $template_path = $oModule->getTemplatePath(); |
| 38 | - if(count($theme_skin) == 2) |
|
| 38 | + if (count($theme_skin) == 2) |
|
| 39 | 39 | { |
| 40 | 40 | $theme_path = sprintf('./themes/%s', $theme_skin[0]); |
| 41 | 41 | // FIXME $theme_path $theme_path $theme_path ?? |
| 42 | - if(substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
|
| 42 | + if (substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
|
| 43 | 43 | { |
| 44 | 44 | $template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); |
| 45 | 45 | } |
@@ -65,16 +65,16 @@ discard block |
||
| 65 | 65 | $oSecurity->encodeHTML('is_keyword'); |
| 66 | 66 | |
| 67 | 67 | // add .x div for adminitration pages |
| 68 | - if(Context::getResponseMethod() == 'HTML') |
|
| 68 | + if (Context::getResponseMethod() == 'HTML') |
|
| 69 | 69 | { |
| 70 | - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
|
| 70 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
|
| 71 | 71 | { |
| 72 | - $output = '<div class="x">' . $output . '</div>'; |
|
| 72 | + $output = '<div class="x">'.$output.'</div>'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if(Context::get('layout') != 'none') |
|
| 75 | + if (Context::get('layout') != 'none') |
|
| 76 | 76 | { |
| 77 | - if(__DEBUG__ == 3) |
|
| 77 | + if (__DEBUG__ == 3) |
|
| 78 | 78 | { |
| 79 | 79 | $start = getMicroTime(); |
| 80 | 80 | } |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | $layout_srl = $layout_info->layout_srl; |
| 93 | 93 | |
| 94 | 94 | // compile if connected to the layout |
| 95 | - if($layout_srl > 0) |
|
| 95 | + if ($layout_srl > 0) |
|
| 96 | 96 | { |
| 97 | 97 | |
| 98 | 98 | // handle separately if the layout is faceoff |
| 99 | - if($layout_info && $layout_info->type == 'faceoff') |
|
| 99 | + if ($layout_info && $layout_info->type == 'faceoff') |
|
| 100 | 100 | { |
| 101 | 101 | $oLayoutModel->doActivateFaceOff($layout_info); |
| 102 | 102 | Context::set('layout_info', $layout_info); |
@@ -105,16 +105,16 @@ discard block |
||
| 105 | 105 | // search if the changes CSS exists in the admin layout edit window |
| 106 | 106 | $edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl); |
| 107 | 107 | |
| 108 | - if(FileHandler::exists($edited_layout_css)) |
|
| 108 | + if (FileHandler::exists($edited_layout_css)) |
|
| 109 | 109 | { |
| 110 | 110 | Context::loadFile(array($edited_layout_css, 'all', '', 100)); |
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | - if(!$layout_path) |
|
| 113 | + if (!$layout_path) |
|
| 114 | 114 | { |
| 115 | 115 | $layout_path = './common/tpl'; |
| 116 | 116 | } |
| 117 | - if(!$layout_file) |
|
| 117 | + if (!$layout_file) |
|
| 118 | 118 | { |
| 119 | 119 | $layout_file = 'default_layout'; |
| 120 | 120 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // if popup_layout, remove admin bar. |
| 124 | 124 | $realLayoutPath = FileHandler::getRealPath($layout_path); |
| 125 | - if(substr_compare($realLayoutPath, '/', -1) !== 0) |
|
| 125 | + if (substr_compare($realLayoutPath, '/', -1) !== 0) |
|
| 126 | 126 | { |
| 127 | 127 | $realLayoutPath .= '/'; |
| 128 | 128 | } |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | $pathInfo = pathinfo($layout_file); |
| 131 | 131 | $onlyLayoutFile = $pathInfo['filename']; |
| 132 | 132 | |
| 133 | - if(__DEBUG__ == 3) |
|
| 133 | + if (__DEBUG__ == 3) |
|
| 134 | 134 | { |
| 135 | 135 | $GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
|
| 138 | + if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
|
| 139 | 139 | { |
| 140 | 140 | Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>'); |
| 141 | 141 | } |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | function prepareToPrint(&$output) |
| 153 | 153 | { |
| 154 | - if(Context::getResponseMethod() != 'HTML') |
|
| 154 | + if (Context::getResponseMethod() != 'HTML') |
|
| 155 | 155 | { |
| 156 | 156 | return; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - if(__DEBUG__ == 3) |
|
| 159 | + if (__DEBUG__ == 3) |
|
| 160 | 160 | { |
| 161 | 161 | $start = getMicroTime(); |
| 162 | 162 | } |
@@ -174,20 +174,20 @@ discard block |
||
| 174 | 174 | $output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output); |
| 175 | 175 | |
| 176 | 176 | // handles a relative path generated by using the rewrite module |
| 177 | - if(Context::isAllowRewrite()) |
|
| 177 | + if (Context::isAllowRewrite()) |
|
| 178 | 178 | { |
| 179 | 179 | $url = parse_url(Context::getRequestUri()); |
| 180 | 180 | $real_path = $url['path']; |
| 181 | 181 | |
| 182 | 182 | $pattern = '/src=("|\'){1}(\.\/)?(files\/attach|files\/cache|files\/faceOff|files\/member_extra_info|modules|common|widgets|widgetstyle|layouts|addons)\/([^"\']+)\.(jpg|jpeg|png|gif)("|\'){1}/s'; |
| 183 | - $output = preg_replace($pattern, 'src=$1' . $real_path . '$3/$4.$5$6', $output); |
|
| 183 | + $output = preg_replace($pattern, 'src=$1'.$real_path.'$3/$4.$5$6', $output); |
|
| 184 | 184 | |
| 185 | 185 | $pattern = '/href=("|\'){1}(\?[^"\']+)/s'; |
| 186 | - $output = preg_replace($pattern, 'href=$1' . $real_path . '$2', $output); |
|
| 186 | + $output = preg_replace($pattern, 'href=$1'.$real_path.'$2', $output); |
|
| 187 | 187 | |
| 188 | - if(Context::get('vid')) |
|
| 188 | + if (Context::get('vid')) |
|
| 189 | 189 | { |
| 190 | - $pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is'; |
|
| 190 | + $pattern = '/\/'.Context::get('vid').'\?([^=]+)=/is'; |
|
| 191 | 191 | $output = preg_replace($pattern, '/?$1=', $output); |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -195,18 +195,18 @@ discard block |
||
| 195 | 195 | // prevent the 2nd request due to url(none) of the background-image |
| 196 | 196 | $output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output); |
| 197 | 197 | |
| 198 | - if(is_array(Context::get('INPUT_ERROR'))) |
|
| 198 | + if (is_array(Context::get('INPUT_ERROR'))) |
|
| 199 | 199 | { |
| 200 | 200 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 201 | 201 | $keys = array_keys($INPUT_ERROR); |
| 202 | - $keys = '(' . implode('|', $keys) . ')'; |
|
| 202 | + $keys = '('.implode('|', $keys).')'; |
|
| 203 | 203 | |
| 204 | - $output = preg_replace_callback('@(<input)([^>]*?)\sname="' . $keys . '"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output); |
|
| 205 | - $output = preg_replace_callback('@<select[^>]*\sname="' . $keys . '".+</select>@isU', array(&$this, '_preserveSelectValue'), $output); |
|
| 206 | - $output = preg_replace_callback('@<textarea[^>]*\sname="' . $keys . '".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output); |
|
| 204 | + $output = preg_replace_callback('@(<input)([^>]*?)\sname="'.$keys.'"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output); |
|
| 205 | + $output = preg_replace_callback('@<select[^>]*\sname="'.$keys.'".+</select>@isU', array(&$this, '_preserveSelectValue'), $output); |
|
| 206 | + $output = preg_replace_callback('@<textarea[^>]*\sname="'.$keys.'".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if(__DEBUG__ == 3) |
|
| 209 | + if (__DEBUG__ == 3) |
|
| 210 | 210 | { |
| 211 | 211 | $GLOBALS['__trans_content_elapsed__'] = getMicroTime() - $start; |
| 212 | 212 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | // convert the final layout |
| 225 | 225 | Context::set('content', $output); |
| 226 | 226 | $oTemplate = TemplateHandler::getInstance(); |
| 227 | - if(Mobile::isFromMobilePhone()) |
|
| 227 | + if (Mobile::isFromMobilePhone()) |
|
| 228 | 228 | { |
| 229 | 229 | $this->_loadMobileJSCSS(); |
| 230 | 230 | $output = $oTemplate->compile('./common/tpl', 'mobile_layout'); |
@@ -249,16 +249,16 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 251 | 251 | |
| 252 | - $str = $match[1] . $match[2] . ' name="' . $match[3] . '"' . $match[4]; |
|
| 252 | + $str = $match[1].$match[2].' name="'.$match[3].'"'.$match[4]; |
|
| 253 | 253 | |
| 254 | 254 | // get type |
| 255 | 255 | $type = 'text'; |
| 256 | - if(preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
|
| 256 | + if (preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
|
| 257 | 257 | { |
| 258 | 258 | $type = strtolower($m[1]); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - switch($type) |
|
| 261 | + switch ($type) |
|
| 262 | 262 | { |
| 263 | 263 | case 'text': |
| 264 | 264 | case 'hidden': |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | case 'number': |
| 277 | 277 | case 'range': |
| 278 | 278 | case 'color': |
| 279 | - $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"'; |
|
| 279 | + $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'"'; |
|
| 280 | 280 | break; |
| 281 | 281 | case 'password': |
| 282 | 282 | $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str); |
@@ -284,14 +284,14 @@ discard block |
||
| 284 | 284 | case 'radio': |
| 285 | 285 | case 'checkbox': |
| 286 | 286 | $str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str); |
| 287 | - if(@preg_match('@\s(?i:value)="' . $INPUT_ERROR[$match[3]] . '"@', $str)) |
|
| 287 | + if (@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) |
|
| 288 | 288 | { |
| 289 | 289 | $str .= ' checked="checked"'; |
| 290 | 290 | } |
| 291 | 291 | break; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - return $str . ' />'; |
|
| 294 | + return $str.' />'; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -308,14 +308,14 @@ discard block |
||
| 308 | 308 | preg_match_all('@<option[^>]*\svalue="([^"]*)".+</option>@isU', $matches[0], $m); |
| 309 | 309 | |
| 310 | 310 | $key = array_search($INPUT_ERROR[$matches[1]], $m[1]); |
| 311 | - if($key === FALSE) |
|
| 311 | + if ($key === FALSE) |
|
| 312 | 312 | { |
| 313 | 313 | return $matches[0]; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | $m[0][$key] = preg_replace('@(\svalue=".*?")@is', '$1 selected="selected"', $m[0][$key]); |
| 317 | 317 | |
| 318 | - return $mm[0] . implode('', $m[0]) . '</select>'; |
|
| 318 | + return $mm[0].implode('', $m[0]).'</select>'; |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | { |
| 328 | 328 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 329 | 329 | preg_match('@<textarea.*?>@is', $matches[0], $mm); |
| 330 | - return $mm[0] . $INPUT_ERROR[$matches[1]] . '</textarea>'; |
|
| 330 | + return $mm[0].$INPUT_ERROR[$matches[1]].'</textarea>'; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /** |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | function _moveStyleToHeader($matches) |
| 340 | 340 | { |
| 341 | - if(isset($matches[1]) && stristr($matches[1], 'scoped')) |
|
| 341 | + if (isset($matches[1]) && stristr($matches[1], 'scoped')) |
|
| 342 | 342 | { |
| 343 | 343 | return $matches[0]; |
| 344 | 344 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function _transMeta($matches) |
| 376 | 376 | { |
| 377 | - if($matches[1]) |
|
| 377 | + if ($matches[1]) |
|
| 378 | 378 | { |
| 379 | 379 | return ''; |
| 380 | 380 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $lang_type = Context::getLangType(); |
| 392 | 392 | |
| 393 | 393 | // add common JS/CSS files |
| 394 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 394 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 395 | 395 | { |
| 396 | 396 | $oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true); |
| 397 | 397 | $oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true); |
@@ -413,9 +413,9 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | // for admin page, add admin css |
| 416 | - if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 416 | + if (Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 417 | 417 | { |
| 418 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 418 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 419 | 419 | { |
| 420 | 420 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); |
| 421 | 421 | $oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | $lang_type = Context::getLangType(); |
| 448 | 448 | |
| 449 | 449 | // add common JS/CSS files |
| 450 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 450 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 451 | 451 | { |
| 452 | 452 | $oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true); |
| 453 | 453 | $oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true); |
@@ -31,25 +31,25 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | function _makeXmlDoc($obj) |
| 33 | 33 | { |
| 34 | - if(!count($obj)) |
|
| 34 | + if (!count($obj)) |
|
| 35 | 35 | { |
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $xmlDoc = ''; |
| 40 | 40 | |
| 41 | - foreach($obj as $key => $val) |
|
| 41 | + foreach ($obj as $key => $val) |
|
| 42 | 42 | { |
| 43 | - if(is_numeric($key)) |
|
| 43 | + if (is_numeric($key)) |
|
| 44 | 44 | { |
| 45 | 45 | $key = 'item'; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if(is_string($val)) |
|
| 48 | + if (is_string($val)) |
|
| 49 | 49 | { |
| 50 | 50 | $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key, "\n"); |
| 51 | 51 | } |
| 52 | - else if(!is_array($val) && !is_object($val)) |
|
| 52 | + else if (!is_array($val) && !is_object($val)) |
|
| 53 | 53 | { |
| 54 | 54 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
| 55 | 55 | } |
@@ -48,12 +48,10 @@ |
||
| 48 | 48 | if(is_string($val)) |
| 49 | 49 | { |
| 50 | 50 | $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key, "\n"); |
| 51 | - } |
|
| 52 | - else if(!is_array($val) && !is_object($val)) |
|
| 51 | + } else if(!is_array($val) && !is_object($val)) |
|
| 53 | 52 | { |
| 54 | 53 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
| 55 | - } |
|
| 56 | - else |
|
| 54 | + } else |
|
| 57 | 55 | { |
| 58 | 56 | $xmlDoc .= sprintf('<%s>%s%s</%s>%s', $key, "\n", $this->_makeXmlDoc($val), $key, "\n"); |
| 59 | 57 | } |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | { |
| 21 | 21 | Context::set('component_info', $info); |
| 22 | 22 | |
| 23 | - if(!$info->extra_vars) |
|
| 23 | + if (!$info->extra_vars) |
|
| 24 | 24 | { |
| 25 | 25 | return; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - foreach($info->extra_vars as $key => $val) |
|
| 28 | + foreach ($info->extra_vars as $key => $val) |
|
| 29 | 29 | { |
| 30 | 30 | $this->{$key} = trim($val->value); |
| 31 | 31 | } |