function _cmf_status_query_build in Content Management Filter 7
Same name and namespace in other branches
- 6.2 cmf.module \_cmf_status_query_build()
- 6 cmf.module \_cmf_status_query_build()
Query_build function for status field.
1 string reference to '_cmf_status_query_build'
- cmf_filters in ./
cmf.module - List node administration filters that can be applied.
File
- ./
cmf.module, line 723 - @brief Content management filter module file
Code
function _cmf_status_query_build($key, $value, $index) {
// Note: no exploitable hole as $key/$value have already been checked when submitted.
list($key, $value) = explode('-', $value, 2);
if ($key == 'sticky') {
// This allows sticky-encoded weighting (like Weight module) to also work.
return array(
'where' => 'n.' . $key . ' ' . ($value == 1 ? '>' : '<') . ' %d',
'value' => 1 - $value,
);
}
else {
return array(
'where' => 'n.' . $key . ' = %d',
'value' => $value,
);
}
}