oDb = BxDolStudioWidgetsQuery::getInstance(); $this->_sType = BX_DOL_STUDIO_WTYPE_DEFAULT; if(($sType = bx_get('type')) !== false) $this->_sType = bx_process_input($sType); $this->aWidgets = array(); $this->aWidgetsNotices = array(); $sWType = $this->_sType != BX_DOL_STUDIO_WTYPE_DEFAULT ? $this->_sType : ''; if(!$this->bPageMultiple) { $this->aWidgets = $this->oDb->getWidgets(array('type' => 'by_page_id', 'value' => $this->aPage['id'], 'wtype' => $sWType)); } else foreach($this->aPage as $sPage => $aPage) $this->aWidgets[$sPage] = $this->oDb->getWidgets(array('type' => 'by_page_id', 'value' => $aPage['id'], 'wtype' => $sWType)); //--- Load Cache (Widgets' Notices) $oCache = $this->oDb->getDbCacheObject(); $sCacheKey = $this->oDb->genDbCacheKey($this->sCacheKeyNotices); $this->aWidgetsNotices = $oCache->getData($sCacheKey); } public function updateCache() { $aWidgets = $this->oDb->getWidgets(array('type' => 'all_with_notices')); $aResult = array(); foreach($aWidgets as $aWidget) { $sNotices = ''; if(BxDolService::isSerializedService($aWidget['cnt_notices'])) { $aService = BxDolService::decodeServiceCall($aWidget['cnt_notices']); if ($aService) $sNotices = BxDolService::call($aService['module'], $aService['method'], array_merge(array($aWidget), isset($aService['params']) ? $aService['params'] : array()), isset($aService['class']) ? $aService['class'] : 'Module'); } $aResult[$aWidget['id']] = $sNotices; } $oCache = $this->oDb->getDbCacheObject(); $sCacheKey = $this->oDb->genDbCacheKey($this->sCacheKeyNotices); return $oCache->setData($sCacheKey, $aResult); } } /** @} */