oDb = new BxDolStudioModulesQuery(); $this->sJsObject = 'oBxDolStudioModules'; $this->sLangPrefix = 'mod'; $this->sTemplPrefix = 'mod'; $this->sParamPrefix = 'mod'; } function serviceGetActions($aWidget) { return array( array ( 'caption' => _t('_adm_' . $this->sLangPrefix . '_txt_uninstall'), 'link' => '', 'click' => $this->sJsObject . ".uninstall(" . $aWidget['id'] . ", '" . $aWidget['page_name'] . "', 0)", 'icon' => 'bx-std-wai-cross.png' ) ); } function processActions() { if(($sAction = bx_get($this->sParamPrefix . '_action')) !== false) { $sAction = bx_process_input($sAction); $aResult = array('code' => 1, 'message' => _t('_adm_' . $this->sLangPrefix . '_err_cannot_process_action')); switch($sAction) { case 'uninstall': $sPageName = bx_process_input(bx_get($this->sParamPrefix . '_page_name')); if(empty($sPageName)) break; bx_import('BxDolModuleQuery'); $aModule = BxDolModuleQuery::getInstance()->getModuleByName($sPageName); if(empty($aModule) || !is_array($aModule)) break; if(($iWidgetId = (int)bx_get($this->sParamPrefix . '_widget_id')) != 0 && (int)bx_get($this->sParamPrefix . '_confirmed') != 1) { $aResult['message'] = $this->getPopupConfirm($iWidgetId, $aModule); break; } bx_import('BxDolStudioInstallerUtils'); $aResult = BxDolStudioInstallerUtils::getInstance()->perform($aModule['path'], 'uninstall'); if(!empty($aResult['message'])) $aResult['message'] = $this->getPopupResult($aResult['message']); break; } if(!empty($aResult['message'])) { bx_import('BxTemplStudioFunctions'); $aResult['message'] = BxTemplStudioFunctions::getInstance()->transBox('', $aResult['message']); } $oJson = new Services_JSON(); echo $oJson->encode($aResult); exit; } } } /** @} */