| @@ -264,7 +264,7 @@ | ||
| 264 | 264 |  	function count ($item) { | 
| 265 | 265 | $item = (int)$item; | 
| 266 | 266 | $L = Language::instance(); | 
| 267 | -		return $this->cache->get("$item/count/$L->clang", function () use ($item)  { | |
| 267 | +		return $this->cache->get("$item/count/$L->clang", function () use ($item) { | |
| 268 | 268 | return $this->count_internal($this->tree_data($item)) ?: 0; | 
| 269 | 269 | }); | 
| 270 | 270 | } | 
| @@ -286,17 +286,20 @@ | ||
| 286 | 286 | $where = []; | 
| 287 | 287 | $where_params = []; | 
| 288 | 288 |  		foreach ($search_parameters as $key => $details) { | 
| 289 | -			if (isset($this->data_model[$key])) { // Property | |
| 289 | +			if (isset($this->data_model[$key])) { | |
| 290 | +// Property | |
| 290 | 291 | $where[] = "`i`.`$key` = '%s'"; | 
| 291 | 292 | $where_params[] = $details; | 
| 292 | -			} elseif (is_numeric($key)) { // Tag | |
| 293 | +			} elseif (is_numeric($key)) { | |
| 294 | +// Tag | |
| 293 | 295 | $joins .= | 
| 294 | 296 |  					"INNER JOIN `{$this->table}_tags` AS `t` | 
| 295 | 297 | ON | 
| 296 | 298 | `i`.`id` = `t`.`id` AND | 
| 297 | 299 | `t`.`tag` = '%s'"; | 
| 298 | 300 | $where_params[] = $details; | 
| 299 | -			} else { // Attribute | |
| 301 | +			} else { | |
| 302 | +// Attribute | |
| 300 | 303 | $field = @$this->attribute_type_to_value_field($Attributes->get($key)['type']); | 
| 301 | 304 |  				if (!$field || empty($details)) { | 
| 302 | 305 | continue; | 
| @@ -27,7 +27,8 @@ | ||
| 27 | 27 | $parent != $category['id'] // infinite loop protection | 
| 28 | 28 |  	) { | 
| 29 | 29 | $parent = $Categories->get($category['parent']); | 
| 30 | -		if ($parent['parent'] == $category['id']) { // infinite loop protection | |
| 30 | +		if ($parent['parent'] == $category['id']) { | |
| 31 | +// infinite loop protection | |
| 31 | 32 | break; | 
| 32 | 33 | } | 
| 33 | 34 | $category['title'] = "$parent[title] :: $category[title]"; | 
| @@ -34,7 +34,8 @@ | ||
| 34 | 34 | $Page->json( | 
| 35 | 35 | $Attributes->get_type_to_name_array() | 
| 36 | 36 | ); | 
| 37 | -} elseif (User::instance()->admin()) { //Hack to re-use contents of this file from `api/admin/attributes.get.php` | |
| 37 | +} elseif (User::instance()->admin()) { | |
| 38 | +//Hack to re-use contents of this file from `api/admin/attributes.get.php` | |
| 38 | 39 | $Page->json( | 
| 39 | 40 | $Attributes->get( | 
| 40 | 41 | $Attributes->get_all() | 
| @@ -349,7 +349,7 @@ | ||
| 349 | 349 | * | 
| 350 | 350 | * @return null|string | 
| 351 | 351 | */ | 
| 352 | -function status_code_string ($code){ | |
| 352 | +function status_code_string ($code) { | |
| 353 | 353 |  	switch ($code) { | 
| 354 | 354 | case 201: | 
| 355 | 355 | $string_code = '201 Created'; |