aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2019-08-14 22:19:24 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-08-14 22:19:24 +0200
commit7fd88adeb081e2996cad48225bf0c74cfe8b90ef (patch)
treebb5edece026aa3fc543dd2a09bd6f3a11ed46a70 /app
parentc82aff177e53685c66d1bd1ab41a893bef29caef (diff)
Add hooks to ExtensionManager (#2482)
Hooks allow to: - add items in menus - perform new actions at the end of FreshRSS initialization
Diffstat (limited to 'app')
-rw-r--r--app/FreshRSS.php2
-rw-r--r--app/layout/aside_configure.phtml3
-rw-r--r--app/layout/header.phtml6
3 files changed, 11 insertions, 0 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 8f614c538..d578beac4 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -53,6 +53,8 @@ class FreshRSS extends Minz_FrontController {
$ext_list = FreshRSS_Context::$user_conf->extensions_enabled;
Minz_ExtensionManager::enableByList($ext_list);
}
+
+ Minz_ExtensionManager::callHook('freshrss_init');
}
private static function initAuth() {
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml
index 94f5b1f6c..747858f4e 100644
--- a/app/layout/aside_configure.phtml
+++ b/app/layout/aside_configure.phtml
@@ -25,6 +25,8 @@
<li class="item<?php echo Minz_Request::controllerName() === 'extension' ? ' active' : ''; ?>">
<a href="<?php echo _url('extension', 'index'); ?>"><?php echo _t('gen.menu.extensions'); ?></a>
</li>
+ <?php echo Minz_ExtensionManager::callHook('menu_configuration_entry'); ?>
+
<?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
<li class="nav-header"><?php echo _t('gen.menu.admin'); ?></li>
<li class="item<?php echo Minz_Request::actionName() === 'system' ? ' active' : ''; ?>">
@@ -47,5 +49,6 @@
<a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a>
</li>
<?php } ?>
+ <?php echo Minz_ExtensionManager::callHook('menu_admin_entry'); ?>
<?php } ?>
</ul>
diff --git a/app/layout/header.phtml b/app/layout/header.phtml
index 410ac1ff0..380575254 100644
--- a/app/layout/header.phtml
+++ b/app/layout/header.phtml
@@ -66,6 +66,8 @@ if (FreshRSS_Auth::accessNeedsAction()) {
<li class="item"><a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('gen.menu.queries'); ?></a></li>
<li class="item"><a href="<?php echo _url('user', 'profile'); ?>"><?php echo _t('gen.menu.user_profile'); ?></a></li>
<li class="item"><a href="<?php echo _url('extension', 'index'); ?>"><?php echo _t('gen.menu.extensions'); ?></a></li>
+ <?php echo Minz_ExtensionManager::callHook('menu_configuration_entry'); ?>
+
<?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
<li class="separator"></li>
<li class="dropdown-header"><?php echo _t('gen.menu.admin'); ?></li>
@@ -76,11 +78,15 @@ if (FreshRSS_Auth::accessNeedsAction()) {
<?php if (!Minz_Configuration::get('system')->disable_update) { ?>
<li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a></li>
<?php } ?>
+ <?php echo Minz_ExtensionManager::callHook('menu_admin_entry'); ?>
<?php } ?>
+
<li class="separator"></li>
<li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('gen.menu.stats'); ?></a></li>
<li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('gen.menu.logs'); ?></a></li>
<li class="item"><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.menu.about'); ?></a></li>
+ <?php echo Minz_ExtensionManager::callHook('menu_other_entry'); ?>
+
<li class="separator"></li>
<?php if (FreshRSS_Auth::accessNeedsAction()): ?>
<li class="item"><a class="signout" href="<?php echo _url('auth', 'logout'); ?>"><?php