|
@@ 1289-1299 (lines=11) @@
|
| 1286 |
|
public function getItemsCount($categoryid = -1, $status = '', $notNullFields = '') |
| 1287 |
|
{ |
| 1288 |
|
global $publisher_isAdmin; |
| 1289 |
|
if (!$publisher_isAdmin) { |
| 1290 |
|
$criteriaPermissions = new CriteriaCompo(); |
| 1291 |
|
// Categories for which user has access |
| 1292 |
|
$categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); |
| 1293 |
|
if (!empty($categoriesGranted)) { |
| 1294 |
|
$grantedCategories = new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'); |
| 1295 |
|
$criteriaPermissions->add($grantedCategories, 'AND'); |
| 1296 |
|
} else { |
| 1297 |
|
return 0; |
| 1298 |
|
} |
| 1299 |
|
} |
| 1300 |
|
if (isset($categoryid) && $categoryid != -1) { |
| 1301 |
|
$criteriaCategory = new criteria('categoryid', $categoryid); |
| 1302 |
|
} |
|
@@ 1449-1459 (lines=11) @@
|
| 1446 |
|
public function getItems($limit = 0, $start = 0, $status = '', $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asobject = true, $otherCriteria = null, $id_key = 'none') |
| 1447 |
|
{ |
| 1448 |
|
global $publisher_isAdmin; |
| 1449 |
|
if (!$publisher_isAdmin) { |
| 1450 |
|
$criteriaPermissions = new CriteriaCompo(); |
| 1451 |
|
// Categories for which user has access |
| 1452 |
|
$categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); |
| 1453 |
|
if (!empty($categoriesGranted)) { |
| 1454 |
|
$grantedCategories = new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'); |
| 1455 |
|
$criteriaPermissions->add($grantedCategories, 'AND'); |
| 1456 |
|
} else { |
| 1457 |
|
return array(); |
| 1458 |
|
} |
| 1459 |
|
} |
| 1460 |
|
if (isset($categoryid) && ($categoryid != -1)) { |
| 1461 |
|
$criteriaCategory = new criteria('categoryid', $categoryid); |
| 1462 |
|
} |