<?php if (!defined('VB_ENTRY')) die('Access denied.'); class vB_Api_Product extends vB_Api { private $assertor; protected $disableWhiteList = array('loadProductJsRollups', 'loadProductCssRollups'); protected function __construct() { parent::__construct(); $this->assertor = vB::getDbAssertor(); } public function loadProductJsRollups() { $library = vB_Library::instance('product'); return $library->loadProductXmlListParsed('jsrollup', true); } public function loadProductCssRollups() { $library = vB_Library::instance('product'); $rollups = $library->loadProductXmlListParsed('cssrollup', true); foreach ($rollups AS $k => $productInfo) { foreach ($productInfo['rollup'] AS $k2 => $productRollup) { if (is_string($productRollup['template'])) { $rollups[$k]['rollup'][$k2]['template'] = array($rollups[$k]['rollup'][$k2]['template']); } } } return $rollups; } public function loadProductCpnavFiles() { $userContext = vB::getUserContext(); if (!$userContext->hasAdminPermission('cancontrolpanel')) { throw new vB_Exception_Api('no_permission'); } $library = vB_Library::instance('product'); return $library->loadProductXmlList('cpnav', true); } private function hasPermission() { $userContext = vB::getUserContext(); $allowed = $userContext->hasAdminPermission('canadminproducts'); return (bool) $allowed; } } 