aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/extensionController.php16
-rw-r--r--app/views/extension/configure.phtml17
2 files changed, 30 insertions, 3 deletions
diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php
index a1e39af37..73b8070cb 100644
--- a/app/Controllers/extensionController.php
+++ b/app/Controllers/extensionController.php
@@ -27,6 +27,22 @@ class FreshRSS_extension_Controller extends Minz_ActionController {
if (Minz_Request::param('ajax')) {
$this->view->_useLayout(false);
}
+
+ $ext_name = urldecode(Minz_Request::param('e'));
+ $ext = Minz_ExtensionManager::find_extension($ext_name);
+
+ if (is_null($ext)) {
+ Minz_Error::error(404);
+ }
+ if ($ext->getType() === 'system' && !FreshRSS_Auth::hasAccess('admin')) {
+ Minz_Error::error(403);
+ }
+
+ $this->view->extension = $ext;
+
+ if (Minz_Request::isPost()) {
+ $this->view->extension->handleConfigureAction();
+ }
}
/**
diff --git a/app/views/extension/configure.phtml b/app/views/extension/configure.phtml
index a79e9baac..295080d5e 100644
--- a/app/views/extension/configure.phtml
+++ b/app/views/extension/configure.phtml
@@ -7,6 +7,17 @@ if (!Minz_Request::param('ajax')) {
?>
<div class="post">
- <h1>Extension name</h1>
- Not implemented yet!
-</div> \ No newline at end of file
+ <h1><?php echo $this->extension->getName(); ?> (<?php echo $this->extension->getVersion(); ?>) — <?php echo $this->extension->getType(); ?></h1>
+
+ <p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?> — <?php echo _t('gen.by'), ' ', $this->extension->getAuthor(); ?></p>
+
+ <h2><?php echo _t('gen.actions.manage'); ?></h2>
+ <?php
+ $configure_view = $this->extension->getConfigureView();
+ if ($configure_view !== false) {
+ echo $configure_view;
+ } else {
+ ?>
+ <p class="alert alert-warn"><?php echo _t('admin.extensions.no_configure_view'); ?></p>
+ <?php } ?>
+</div>