Example #1
0
 public function indexAction()
 {
     if ($this->getRequest()->isPost()) {
         $this->installForm->setData(array_merge_recursive($this->getRequest()->getPost()->toArray(), $this->getRequest()->getFiles()->toArray()));
         if ($this->installForm->isValid()) {
             $data = $this->installForm->getData();
             if ($data['plugin']['error'] === 0) {
                 $this->pluginManager->installFile($data['plugin']['tmp_name']);
             } else {
                 $this->pluginManager->installExternal($data['location']);
             }
             $this->flashMessenger()->addSuccessMessage('The plugin has been installed.');
             return $this->redirect()->toRoute('admin/system/plugins');
         }
     }
     return new ViewModel(['plugins' => $this->pluginManager->getPlugins(), 'installForm' => $this->installForm]);
 }
Example #2
0
 public function fetchAll($params = array())
 {
     $adapter = new ArrayAdapter($this->pluginManager->getPlugins());
     return new PluginCollection($adapter);
 }