Browse apps: Include sub-categories when filtering by category
This commit is contained in:
@@ -18,6 +18,7 @@ define('FILTER_LESS_THAN', 7);
|
||||
define('FILTER_NOT_EQUALS', 8);
|
||||
define('FILTER_NOT_LIKE', 9);
|
||||
define('FILTER_OPTION_BOOL', 10);
|
||||
define('FILTER_OPTION_ENUM', 11);
|
||||
|
||||
/* A filter as part of an SQL query, such as something = 'somevalue' */
|
||||
class Filter
|
||||
@@ -82,7 +83,7 @@ class Filter
|
||||
public function getExpression()
|
||||
{
|
||||
/* We let callers handle options themselves, so don't include them in the WHERE clause */
|
||||
if($this->iType == FILTER_OPTION_BOOL)
|
||||
if($this->isOption())
|
||||
return '';
|
||||
|
||||
$sData = $this->sData;
|
||||
@@ -105,6 +106,19 @@ class Filter
|
||||
|
||||
return "{$this->sColumn} $sOp '$sData'";
|
||||
}
|
||||
|
||||
public function IsOption()
|
||||
{
|
||||
switch($this->iType)
|
||||
{
|
||||
case FILTER_OPTION_BOOL:
|
||||
case FILTER_OPTION_ENUM:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Class handling tables where the user can filter contents */
|
||||
|
||||
Reference in New Issue
Block a user