private function getPluginName($pid) { require_once 'plugin.class.php'; $currentPlugin = new Plugin(); $currentPlugin->pid = $pid; return json_decode($currentPlugin->getData(), true)['name']; }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_banner_place']); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_banner']); $this->uninstallAggregateViewStatisticJob(); $this->deactivatePhpScript(self::BANNER_PHP_SCRIPT_TYPE_ID); //удаляем SiteModule связанных с баннерами, если таковые имеются $idsPhpScript = Yii::app()->db->createCommand()->select('id_php_script')->from('da_php_script')->where('id_php_script_type = "' . self::BANNER_PHP_SCRIPT_TYPE_ID . '"')->queryAll(); if ($idsPhpScript) { $idsPhpScriptArray = array(); foreach ($idsPhpScript as $idPhpScript) { $idsPhpScriptArray[] = $idPhpScript['id_php_script']; } //отцепляем виджеты от наборов $idsSiteModule = Yii::app()->db->createCommand()->select('id_module')->from('da_site_module')->where('id_php_script IN (' . implode(',', $idsPhpScriptArray) . ')')->queryAll(); $idsSiteModuleArray = array(); foreach ($idsSiteModule as $idSiteModule) { $idsSiteModuleArray[] = $idSiteModule['id_module']; } $criteria = new CDbCriteria(); $criteria->addInCondition('id_module', $idsSiteModuleArray); Yii::app()->db->commandBuilder->createDeleteCommand('da_site_module_rel', $criteria)->execute(); //удаляем сами модули $criteria = new CDbCriteria(); $criteria->addInCondition('id_php_script', $idsPhpScriptArray); Yii::app()->db->commandBuilder->createDeleteCommand('da_site_module', $criteria)->execute(); //Yii::app()->db->createCommand()->update('da_site_module',array('is_visible' => 0),array('in','id_php_script',$idsPhpScriptArray)); //удаляем php_script $criteria = new CDbCriteria(); $criteria->compare('id_php_script_type', self::BANNER_PHP_SCRIPT_TYPE_ID); Yii::app()->db->commandBuilder->createDeleteCommand('da_php_script', $criteria)->execute(); } $this->updateMenu = true; }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); if ($data === null || !isset($data['id_site_module'])) { throw new ErrorException('Плагин установлен неверно.'); } $data = $this->deleteSiteModule($data['id_site_module'], $data, 'site_module_place'); unset($data['id_site_module']); $plugin->setData($data); }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); if ($data === null || !isset($data['idMenu'])) { throw new ErrorException('Плагин установлен неверно.'); } $data = $this->deleteMenu($data['idMenu'], $data); unset($data['idMenu']); $plugin->setData($data); }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); if ($data === null || !isset($data['id_site_module'])) { throw new ErrorException('Плагин установлен неверно.'); } $data = $this->deleteSiteModule($data['id_site_module'], $data, 'site_module_place'); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object']); $this->updateMenu = true; unset($data['id_site_module']); $plugin->setData($data); }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); if ($data === null || !isset($data['id_menu'])) { throw new ErrorException('Плагин установлен неверно.'); } $data = $this->deleteMenu($data['id_menu'], $data, 'id_menu_module_template'); // Удаляем: все отправленные и неотправленные события по типу события + подписчиков + тип события $eventType = NotifierEventType::model()->findByPk($data['id_event_type']); if ($eventType != null) { $eventType->delete(); } Yii::app()->authManager->removeAuthItemObject('list', $data['id_object']); $this->updateMenu = true; unset($data['id_menu'], $data['id_event_type']); $plugin->setData($data); }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); if ($data === null || !isset($data['id_site_module'])) { throw new ErrorException('Плагин установлен неверно.'); } $siteModule = SiteModule::model()->findByPk($data['id_site_module']); $idBannerPlace = $siteModule->phpScriptInstance->getParameterValue('idBannerPlace'); if (is_numeric($idBannerPlace) && ($bp = BannerPlace::model()->findByPk($idBannerPlace)) != null) { if (count($bp->banners) == 0) { $bp->delete(); } } $data = $this->deleteSiteModule($data['id_site_module'], $data, 'site_module_place'); unset($data['id_site_module']); $plugin->setData($data); }
public function updatePlugin(Plugin $plugin) { $data = $plugin->getData(); if ($plugin->getIsEnabled()) { $data = array_merge($data, $this->setupEventRegister()); } $plugin->setData($data); }
public function deactivate(Plugin $plugin) { $data = $plugin->getData(); if ($data === null || !isset($data['id_menu'])) { throw new ErrorException('Плагин установлен неверно.'); } // Удаляем: все отправленные и неотправленные события по типу события + подписчиков + тип события $eventType = NotifierEventType::model()->findByPk(@$data['idEventTypeNewOffer']); if ($eventType != null) { $eventType->delete(); } $data = $this->deleteMenu($data['id_menu'], $data, 'id_menu_module_template'); $data = $this->deleteSiteModule($data['id_site_module_category'], $data, 'site_module_place_category'); $data = $this->deleteSiteModule($data['id_site_module_cart'], $data, 'site_module_place_cart'); $data = $this->deleteSiteModule($data['id_site_module_brand'], $data, 'site_module_place_brand'); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_product']); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_category']); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_offer']); Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_brand']); if (!isset($data['id_object_remain_status'])) { $data['id_object_remain_status'] = 529; } Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_remain_status']); if (!isset($data['id_object_invoice'])) { $data['id_object_invoice'] = 'id_object_invoice'; } Yii::app()->authManager->removeAuthItemObject('list', $data['id_object_invoice']); $this->updateMenu = true; unset($data['id_menu'], $data['id_site_module_category'], $data['id_site_module_cart'], $data['id_site_module_brand']); $plugin->setData($data); }
public function updatePlugin(Plugin $plugin) { $data = $plugin->getData(); if (!isset($data['id_php_script_type_widget_random_photo'])) { $data['id_php_script_type_widget_random_photo'] = 1045; } if ($plugin->getIsEnabled()) { if (isset($data['useGallery']) && $data['useGallery']) { $data = $this->setupRandomPhotoWidget($data); } } $plugin->setData($data); }
public function onChangeConfig(Plugin $plugin) { $config = $plugin->getConfig(); $data = $plugin->getData(); if (isset($config['modules']['ygin.news']['showCategories']) && $config['modules']['ygin.news']['showCategories'] === true) { $this->installCategory($data); } else { $this->uninstallCategory($data); } }
$currentCalculation = new Calculation(); require_once 'site.class.php'; $uid = Site::getSessionUid(); if ($uid == 0) { handle(ERROR_PERMISSION . '01' . '请先登陆!'); } require_once 'user.class.php'; $currentUser = new User(); $currentUser->uid = $uid; $response = json_decode($currentUser->getData(), true); $priority = $response['level']; if ($priority != 9) { require_once 'plugin.class.php'; $currentPlugin = new Plugin(); $currentPlugin->pid = getRequest('pid'); $response = json_decode($currentPlugin->getData(), true); if ($uid == $response['uid']) { $priority = 5; } } $currentCalculation->init(getRequest('pid'), $uid, $priority, 0, '', 0, getRequest('input')); if (!$currentCalculation->checkVariables()) { handle(ERROR_INPUT . '01'); } $response = $currentCalculation->create(); if ($response === false) { handle(ERROR_SYSTEM . '00'); } handle('0000{"cid":' . $response . '}'); break; case 'renew':