/** * Delete plugin * * @param string $alias Name of plugin * * @throws NotFoundException * @throws MethodNotAllowedException */ public function admin_delete($alias) { if (!$this->request->is('post')) { throw new MethodNotAllowedException(); } if (!array_key_exists($alias, HuradPlugin::getPluginData())) { throw new NotFoundException(__d('hurad', 'Plugin not exist')); } if (HuradPlugin::isActive($alias)) { throw new MethodNotAllowedException(); } $output = HuradPlugin::delete($alias); if ($output === true) { $this->Session->setFlash(__d('hurad', 'Plugin deleted'), 'flash_message', array('class' => 'success')); $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__d('hurad', '<b>Occurred error:</b><br>') . implode('<br>', $output), 'flash_message', array('class' => 'danger')); $this->redirect(array('action' => 'index')); } }
App::uses('HuradRole', 'Lib'); App::uses('HuradNavigation', 'Lib'); App::uses('HuradRowActions', 'Lib'); App::uses('HuradMetaBox', 'Lib'); App::uses('HuradL10n', 'Lib'); /** * Include default capabilities */ config('Hurad/default_capabilities'); /** * Include default navigation */ config('Hurad/default_navigation'); /** * Load all active plugins */ HuradPlugin::loadAll(['Utils']); /** * Include default widgets */ config('Hurad/default_widgets'); /** * Include current theme bootstrap file. */ $theme_bootstrap = APP . 'View' . DS . 'Themed' . DS . Configure::read('template') . DS . 'Config' . DS . 'bootstrap.php'; if (is_file($theme_bootstrap) && file_exists($theme_bootstrap)) { include $theme_bootstrap; } Configure::write('Config.language', Configure::read('General.language')); Configure::write('Hurad.language', Configure::read('General.language')); Configure::write('Hurad.language.catalog', HuradL10n::getAvailableLocale()[Configure::read('General.language')]);