} public function action_repo() { Assets::package('backbone'); $this->set_title(__('Repository')); $this->template->content = View::factory('plugins/repo'); } public function action_settings() { $plugin_id = $this->request->param('id');
public function rest_put() { if (!ACL::check('plugins.change_status')) { throw HTTP_API_Exception::factory(API::ERROR_PERMISSIONS, 'You don\'t have permission to :permission', array(':permission' => __('Install or uninstall plugin'))); } Plugins::find_all(); $plugin = Plugins::get_registered($this->param('id', NULL, TRUE)); if (!$plugin->is_activated() and (bool) $this->param('installed') === TRUE) { $plugin->activate(); } else { $plugin->deactivate((bool) $this->param('remove_data')); } Kohana::$log->add(Log::INFO, ':user :action plugin :name', array(':action' => $plugin->is_activated() ? 'activate' : 'deactivate', ':name' => $plugin->title()))->write(); $this->response($this->_get_info($plugin)); }
<?php defined('SYSPATH') or die('No direct access allowed.'); $plugins = Arr::get($post, 'plugins', array()); if (!empty($post['insert_test_data'])) { $plugins['test'] = 'test'; } Plugins::find_all(); foreach ($plugins as $name) { $plugin = Plugins::get_registered($name); if ($plugin instanceof Plugin_Decorator and $plugin->is_installable()) { $plugin->activate(); } }
/** * * @return array [$plugin] */ public function fetch_data() { $plugin = Plugins::get_registered('disqus'); return array('plugin' => $plugin); }