mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
provide separate plugin settings page, update demo plugin, fix hook_register
This commit is contained in:
parent
6891d44e0b
commit
d045fd04d4
8 changed files with 40 additions and 8 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue