aboutsummaryrefslogtreecommitdiffstats
path: root/mod/settings.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-24 23:44:17 -0800
committerFriendika <info@friendika.com>2010-12-24 23:44:17 -0800
commitd045fd04d4b42a749a113dd27f439f9766800975 (patch)
tree78ab3b0ecaea1695249fe862bf051d1d616937dc /mod/settings.php
parent6891d44e0b765d230bd3b483c5e283647947c4cb (diff)
downloadvolse-hubzilla-d045fd04d4b42a749a113dd27f439f9766800975.tar.gz
volse-hubzilla-d045fd04d4b42a749a113dd27f439f9766800975.tar.bz2
volse-hubzilla-d045fd04d4b42a749a113dd27f439f9766800975.zip
provide separate plugin settings page, update demo plugin, fix hook_register
Diffstat (limited to 'mod/settings.php')
-rw-r--r--mod/settings.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/mod/settings.php b/mod/settings.php
index b10f9e3fc..000258db9 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -17,6 +17,9 @@ function settings_post(&$a) {
call_hooks('settings_post', $_POST);
+ if(($a->argc > 1) && ($a->argv[1] == 'addon'))
+ return;
+
if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
notice( t('Permission denied.') . EOL);
return;
@@ -182,6 +185,21 @@ function settings_content(&$a) {
return;
}
+ if(($a->argc > 1) && ($a->argv[1] === 'addon')) {
+ $o .= '<h1>' . t('Plugin Settings') . '</h1>';
+ $o .= '<div id="account-settings-link"><a href="settings">' . t('Account Settings') . '</a></div>';
+
+ $o .= '<form action="settings/addon" method="post" >';
+
+ $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
+ if(! count($r))
+ notice('No Plugin settings configured');
+
+ call_hooks('plugin_settings', $o);
+ $o .= '</form>';
+ return $o;
+ }
+
require_once('include/acl_selectors.php');
$p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",