';
}
- call_hooks('jot_networks', $jotnets);
+ Addon::callHooks('jot_networks', $jotnets);
} else {
$jotnets .= sprintf(t('Connectors disabled, since "%s" is enabled.'),
t('Hide your profile details from unknown viewers?'));
@@ -671,7 +672,7 @@ function acl_lookup(App $a, $out_type = 'json')
'search' => $search,
];
- call_hooks('acl_lookup_end', $results);
+ Addon::callHooks('acl_lookup_end', $results);
if ($out_type === 'html') {
$o = [
diff --git a/include/api.php b/include/api.php
index b4fdb646f9..7011f613d6 100644
--- a/include/api.php
+++ b/include/api.php
@@ -8,6 +8,7 @@
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\NotificationsManager;
@@ -166,7 +167,7 @@ function api_login(App $a)
list($consumer, $token) = $oauth1->verify_request(OAuthRequest::from_request());
if (!is_null($token)) {
$oauth1->loginUser($token->uid);
- call_hooks('logged_in', $a->user);
+ Addon::callHooks('logged_in', $a->user);
return;
}
echo __FILE__.__LINE__.__FUNCTION__ . "
";
@@ -216,7 +217,7 @@ function api_login(App $a)
* Plugins should never set 'authenticated' except to indicate success - as hooks may be chained
* and later plugins should not interfere with an earlier one that succeeded.
*/
- call_hooks('authenticate', $addon_auth);
+ Addon::callHooks('authenticate', $addon_auth);
if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) {
$record = $addon_auth['user_record'];
@@ -239,7 +240,7 @@ function api_login(App $a)
$_SESSION["allow_api"] = true;
- call_hooks('logged_in', $a->user);
+ Addon::callHooks('logged_in', $a->user);
}
/**
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index fc25a584a9..4856d18ab1 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -1,6 +1,7 @@
', '
', $Text);
//$Text = str_replace('
$items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
- call_hooks('conversation_start',$cb);
+ Addon::callHooks('conversation_start',$cb);
$items = $cb['items'];
@@ -731,7 +732,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
}
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
- call_hooks('render_location',$locate);
+ Addon::callHooks('render_location',$locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
@@ -820,7 +821,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
];
$arr = ['item' => $item, 'output' => $tmp_item];
- call_hooks('display_item', $arr);
+ Addon::callHooks('display_item', $arr);
$threads[$threadsid]['id'] = $item['item_id'];
$threads[$threadsid]['network'] = $item['item_network'];
@@ -864,7 +865,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
continue;
}
- call_hooks('display_item', $arr);
+ Addon::callHooks('display_item', $arr);
$item['pagedrop'] = $page_dropping;
@@ -1075,7 +1076,7 @@ function item_photo_menu($item) {
$args = ['item' => $item, 'menu' => $menu];
- call_hooks('item_photo_menu', $args);
+ Addon::callHooks('item_photo_menu', $args);
$menu = $args['menu'];
@@ -1297,7 +1298,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
]);
$jotplugins = '';
- call_hooks('jot_tool', $jotplugins);
+ Addon::callHooks('jot_tool', $jotplugins);
// Private/public post links for the non-JS ACL form
$private_post = 1;
diff --git a/include/enotify.php b/include/enotify.php
index 286a372e9c..ab4bbc6db2 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -3,6 +3,7 @@
* @file include/enotify.php
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
@@ -398,7 +399,7 @@ function notification($params)
'itemlink' => $itemlink
];
- call_hooks('enotify', $h);
+ Addon::callHooks('enotify', $h);
$subject = $h['subject'];
@@ -440,7 +441,7 @@ function notification($params)
$datarray['otype'] = $params['otype'];
$datarray['abort'] = false;
- call_hooks('enotify_store', $datarray);
+ Addon::callHooks('enotify_store', $datarray);
if ($datarray['abort']) {
pop_lang();
@@ -576,7 +577,7 @@ function notification($params)
$datarray['subject'] = $subject;
$datarray['headers'] = $additional_mail_header;
- call_hooks('enotify_mail', $datarray);
+ Addon::callHooks('enotify_mail', $datarray);
// check whether sending post content in email notifications is allowed
// always true for SYSTEM_EMAIL
@@ -667,7 +668,7 @@ function check_user_notification($itemid) {
*/
function check_item_notification($itemid, $uid, $defaulttype = "") {
$notification_data = ["uid" => $uid, "profiles" => []];
- call_hooks('check_item_notification', $notification_data);
+ Addon::callHooks('check_item_notification', $notification_data);
$profiles = $notification_data["profiles"];
diff --git a/include/event.php b/include/event.php
index d4c97c750c..64ccf3f53c 100644
--- a/include/event.php
+++ b/include/event.php
@@ -6,6 +6,7 @@
use Friendica\App;
use Friendica\Content\Feature;
+use Friendica\Core\Addon;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@@ -328,7 +329,7 @@ function event_store($arr) {
$item_id = 0;
}
- call_hooks("event_updated", $arr['id']);
+ Addon::callHooks("event_updated", $arr['id']);
return $item_id;
} else {
@@ -406,7 +407,7 @@ function event_store($arr) {
);
}
- call_hooks("event_created", $event['id']);
+ Addon::callHooks("event_created", $event['id']);
return $item_id;
}
diff --git a/include/friendica_smarty.php b/include/friendica_smarty.php
index 1992a3716e..f0d819d623 100644
--- a/include/friendica_smarty.php
+++ b/include/friendica_smarty.php
@@ -1,5 +1,6 @@
basename($s->filename),
"vars" => $r
];
- call_hooks("template_vars", $arr);
+ Addon::callHooks("template_vars", $arr);
$r = $arr['vars'];
foreach ($r as $key => $value) {
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 75f05f453d..2404e42f6b 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -8,6 +8,7 @@
* https://github.com/annando/Syncom
*/
+use Friendica\Core\Addon;
use Friendica\Util\XML;
function node2bbcode(&$doc, $oldnode, $attributes, $startbb, $endbb)
@@ -261,7 +262,7 @@ function html2bbcode($message, $basepath = '')
$message = preg_replace('=\r *\r=i', "\n", $message);
$message = str_replace("\r", "\n", $message);
- call_hooks('html2bbcode', $message);
+ Addon::callHooks('html2bbcode', $message);
$message = strip_tags($message);
diff --git a/include/items.php b/include/items.php
index e99799ad66..be370b3d19 100644
--- a/include/items.php
+++ b/include/items.php
@@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Content\Feature;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
@@ -157,7 +158,7 @@ function title_is_body($title, $body) {
}
function add_page_info_data($data) {
- call_hooks('page_info_data', $data);
+ Addon::callHooks('page_info_data', $data);
// It maybe is a rich content, but if it does have everything that a link has,
// then treat it that way
@@ -943,9 +944,9 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
put_item_in_cache($arr);
if ($notify) {
- call_hooks('post_local', $arr);
+ Addon::callHooks('post_local', $arr);
} else {
- call_hooks('post_remote', $arr);
+ Addon::callHooks('post_remote', $arr);
}
// This array field is used to trigger some automatic reactions
@@ -1086,9 +1087,9 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
$r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
if ((DBM::is_result($r)) && (count($r) == 1)) {
if ($notify) {
- call_hooks('post_local_end', $r[0]);
+ Addon::callHooks('post_local_end', $r[0]);
} else {
- call_hooks('post_remote_end', $r[0]);
+ Addon::callHooks('post_remote_end', $r[0]);
}
} else {
logger('item_store: new item not found in DB, id ' . $current_post);
@@ -1364,7 +1365,7 @@ function tag_deliver($uid, $item_id)
$arr = ['item' => $item, 'user' => $u[0], 'contact' => $r[0]];
- call_hooks('tagged', $arr);
+ Addon::callHooks('tagged', $arr);
if ((! $community_page) && (! $prvgroup)) {
return;
diff --git a/include/like.php b/include/like.php
index f89b7a82e6..1dbdcc936d 100644
--- a/include/like.php
+++ b/include/like.php
@@ -1,6 +1,7 @@
user);
+ Addon::callHooks('logged_in', $a->user);
if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
diff --git a/include/text.php b/include/text.php
index 5ce0b850ef..6856d28aa3 100644
--- a/include/text.php
+++ b/include/text.php
@@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Content\Smilies;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@@ -969,7 +970,7 @@ function contact_block() {
$arr = ['contacts' => $r, 'output' => $o];
- call_hooks('contact_block_end', $arr);
+ Addon::callHooks('contact_block_end', $arr);
return $o;
}
@@ -1123,7 +1124,7 @@ function get_poke_verbs() {
'finger' => ['fingered', t('finger'), t('fingered')],
'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')],
];
- call_hooks('poke_verbs', $arr);
+ Addon::callHooks('poke_verbs', $arr);
return $arr;
}
@@ -1255,7 +1256,7 @@ function put_item_in_cache(&$item, $update = false)
function prepare_body(&$item, $attach = false, $preview = false) {
$a = get_app();
- call_hooks('prepare_body_init', $item);
+ Addon::callHooks('prepare_body_init', $item);
$searchpath = System::baseUrl() . "/search?tag=";
@@ -1314,7 +1315,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
$s = $item["rendered-html"];
$prep_arr = ['item' => $item, 'html' => $s, 'preview' => $preview];
- call_hooks('prepare_body', $prep_arr);
+ Addon::callHooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
if (! $attach) {
@@ -1432,7 +1433,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
}
$prep_arr = ['item' => $item, 'html' => $s];
- call_hooks('prepare_body_final', $prep_arr);
+ Addon::callHooks('prepare_body_final', $prep_arr);
return $prep_arr['html'];
}
diff --git a/index.php b/index.php
index dcb25cc3a3..c4ccc9ef24 100644
--- a/index.php
+++ b/index.php
@@ -11,6 +11,7 @@
use Friendica\App;
use Friendica\BaseObject;
use Friendica\Content\Nav;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@@ -75,8 +76,8 @@ if (!$install) {
}
require_once 'include/session.php';
- load_hooks();
- call_hooks('init_1');
+ Addon::loadHooks();
+ Addon::callHooks('init_1');
$maintenance = Config::get('system', 'maintenance');
}
@@ -200,7 +201,7 @@ $privateapps = Config::get('config', 'private_addons');
if ((local_user()) || (! $privateapps === "1")) {
$arr = ['app_menu' => $a->apps];
- call_hooks('app_menu', $arr);
+ Addon::callHooks('app_menu', $arr);
$a->apps = $arr['app_menu'];
}
@@ -243,7 +244,7 @@ if (strlen($a->module)) {
if (is_array($a->plugins) && in_array($a->module, $a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
//Check if module is an app and if public access to apps is allowed or not
- if ((!local_user()) && plugin_is_app($a->module) && $privateapps === "1") {
+ if ((!local_user()) && Addon::isApp($a->module) && $privateapps === "1") {
info(t("You must be logged in to use addons. "));
} else {
include_once "addon/{$a->module}/{$a->module}.php";
@@ -317,7 +318,7 @@ if (! x($a->page, 'content')) {
}
if (!$install && !$maintenance) {
- call_hooks('page_content_top', $a->page['content']);
+ Addon::callHooks('page_content_top', $a->page['content']);
}
/**
@@ -329,10 +330,10 @@ if ($a->module_loaded) {
$placeholder = '';
if ($a->module_class) {
- call_hooks($a->module . '_mod_init', $placeholder);
+ Addon::callHooks($a->module . '_mod_init', $placeholder);
call_user_func([$a->module_class, 'init']);
} else if (function_exists($a->module . '_init')) {
- call_hooks($a->module . '_mod_init', $placeholder);
+ Addon::callHooks($a->module . '_mod_init', $placeholder);
$func = $a->module . '_init';
$func($a);
}
@@ -343,7 +344,7 @@ if ($a->module_loaded) {
}
if (! $a->error && $_SERVER['REQUEST_METHOD'] === 'POST') {
- call_hooks($a->module . '_mod_post', $_POST);
+ Addon::callHooks($a->module . '_mod_post', $_POST);
if ($a->module_class) {
call_user_func([$a->module_class, 'post']);
} else if (function_exists($a->module . '_post')) {
@@ -353,7 +354,7 @@ if ($a->module_loaded) {
}
if (! $a->error) {
- call_hooks($a->module . '_mod_afterpost', $placeholder);
+ Addon::callHooks($a->module . '_mod_afterpost', $placeholder);
if ($a->module_class) {
call_user_func([$a->module_class, 'afterpost']);
} else if (function_exists($a->module . '_afterpost')) {
@@ -364,7 +365,7 @@ if ($a->module_loaded) {
if (! $a->error) {
$arr = ['content' => $a->page['content']];
- call_hooks($a->module . '_mod_content', $arr);
+ Addon::callHooks($a->module . '_mod_content', $arr);
$a->page['content'] = $arr['content'];
if ($a->module_class) {
$arr = ['content' => call_user_func([$a->module_class, 'content'])];
@@ -372,7 +373,7 @@ if ($a->module_loaded) {
$func = $a->module . '_content';
$arr = ['content' => $func($a)];
}
- call_hooks($a->module . '_mod_aftercontent', $arr);
+ Addon::callHooks($a->module . '_mod_aftercontent', $arr);
$a->page['content'] .= $arr['content'];
}
@@ -421,7 +422,7 @@ if (stristr(implode("", $_SESSION['sysmsg']), t('Permission denied'))) {
/*
* Report anything which needs to be communicated in the notification area (before the main body)
*/
-call_hooks('page_end', $a->page['content']);
+Addon::callHooks('page_end', $a->page['content']);
/*
* Add the navigation (menu) template
diff --git a/mod/admin.php b/mod/admin.php
index 9c286c11dd..fd8a61cb2b 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -8,6 +8,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Text\Markdown;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
@@ -1757,11 +1758,11 @@ function admin_page_plugins(App $a)
$idx = array_search($plugin, $a->plugins);
if ($idx !== false) {
unset($a->plugins[$idx]);
- uninstall_plugin($plugin);
+ Addon::uninstall($plugin);
info(t("Plugin %s disabled.", $plugin));
} else {
$a->plugins[] = $plugin;
- install_plugin($plugin);
+ Addon::install($plugin);
info(t("Plugin %s enabled.", $plugin));
}
Config::set("system", "addon", implode(", ", $a->plugins));
@@ -1804,7 +1805,7 @@ function admin_page_plugins(App $a)
'$plugin' => $plugin,
'$status' => $status,
'$action' => $action,
- '$info' => get_plugin_info($plugin),
+ '$info' => Addon::getInfo($plugin),
'$str_author' => t('Author: '),
'$str_maintainer' => t('Maintainer: '),
@@ -1822,7 +1823,7 @@ function admin_page_plugins(App $a)
*/
if (x($_GET, "a") && $_GET['a'] == "r") {
check_form_security_token_redirectOnErr(System::baseUrl() . '/admin/plugins', 'admin_themes', 't');
- reload_plugins();
+ Addon::reload();
info("Plugins reloaded");
goaway(System::baseUrl() . '/admin/plugins');
}
@@ -1833,7 +1834,7 @@ function admin_page_plugins(App $a)
foreach ($files as $file) {
if (is_dir($file)) {
list($tmp, $id) = array_map("trim", explode("/", $file));
- $info = get_plugin_info($id);
+ $info = Addon::getInfo($id);
$show_plugin = true;
// If the addon is unsupported, then only show it, when it is enabled
diff --git a/mod/contacts.php b/mod/contacts.php
index 682d427c6d..dfda3a3363 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -173,7 +174,7 @@ function contacts_post(App $a)
return; // NOTREACHED
}
- call_hooks('contact_edit_post', $_POST);
+ Addon::callHooks('contact_edit_post', $_POST);
$profile_id = intval($_POST['profile-assign']);
if ($profile_id) {
@@ -662,7 +663,7 @@ function contacts_content(App $a)
$arr = ['contact' => $contact, 'output' => $o];
- call_hooks('contact_edit', $arr);
+ Addon::callHooks('contact_edit', $arr);
return $arr['output'];
}
diff --git a/mod/directory.php b/mod/directory.php
index 6398127cf5..5afaa08c64 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@@ -174,7 +175,7 @@ function directory_content(App $a) {
$arr = ['contact' => $rr, 'entry' => $entry];
- call_hooks('directory_item', $arr);
+ Addon::callHooks('directory_item', $arr);
unset($profile);
unset($location);
diff --git a/mod/editpost.php b/mod/editpost.php
index 117cb3fb19..9e3401e958 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Content\Feature;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
@@ -94,8 +95,8 @@ function editpost_content(App $a) {
- call_hooks('jot_tool', $jotplugins);
- //call_hooks('jot_networks', $jotnets);
+ Addon::callHooks('jot_tool', $jotplugins);
+ //Addon::callHooks('jot_networks', $jotnets);
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
diff --git a/mod/friendica.php b/mod/friendica.php
index 7f48ae3d4a..7a9f6c6f61 100644
--- a/mod/friendica.php
+++ b/mod/friendica.php
@@ -1,6 +1,7 @@
' . PHP_EOL;
}
- call_hooks('about_hook', $o);
+ Addon::callHooks('about_hook', $o);
return $o;
}
diff --git a/mod/home.php b/mod/home.php
index 614fd0e3e8..dc571aaabd 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -1,6 +1,7 @@
user['nickname'])) {
goaway(System::baseUrl()."/network");
@@ -46,7 +47,7 @@ function home_content(App $a) {
$login = Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
$content = '';
- call_hooks("home_content",$content);
+ Addon::callHooks("home_content",$content);
$tpl = get_markup_template('home.tpl');
diff --git a/mod/item.php b/mod/item.php
index 4b284568aa..ef4bf8dbce 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -15,6 +15,7 @@
* information.
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
@@ -50,7 +51,7 @@ function item_post(App $a) {
killme();
}
- call_hooks('post_local_start', $_REQUEST);
+ Addon::callHooks('post_local_start', $_REQUEST);
// logger('postinput ' . file_get_contents('php://input'));
logger('postvars ' . print_r($_REQUEST,true), LOGGER_DATA);
@@ -772,7 +773,7 @@ function item_post(App $a) {
killme();
}
- call_hooks('post_local',$datarray);
+ Addon::callHooks('post_local',$datarray);
if (x($datarray, 'cancel')) {
logger('mod_item: post cancelled by plugin.');
@@ -885,7 +886,7 @@ function item_post(App $a) {
}
}
- call_hooks('post_local_end', $datarray);
+ Addon::callHooks('post_local_end', $datarray);
if (strlen($emailcc) && $profile_uid == local_user()) {
$erecips = explode(',', $emailcc);
diff --git a/mod/lockview.php b/mod/lockview.php
index ced03d1b56..ead2269c7a 100644
--- a/mod/lockview.php
+++ b/mod/lockview.php
@@ -1,6 +1,7 @@
';
diff --git a/mod/manage.php b/mod/manage.php
index f2781f1081..dde08d3fac 100644
--- a/mod/manage.php
+++ b/mod/manage.php
@@ -1,6 +1,7 @@
user['nickname'] );
// NOTREACHED
diff --git a/mod/network.php b/mod/network.php
index c08d8e68d6..6bb1cf387c 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -7,6 +7,7 @@ use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
@@ -388,7 +389,7 @@ function network_content(App $a, $update = 0) {
/// @TODO Is this really necessary? $a is already available to hooks
$arr = ['query' => $a->query_string];
- call_hooks('network_content_init', $arr);
+ Addon::callHooks('network_content_init', $arr);
$nouveau = false;
@@ -1006,7 +1007,7 @@ function network_tabs(App $a)
}
$arr = ['tabs' => $tabs];
- call_hooks('network_tabs', $arr);
+ Addon::callHooks('network_tabs', $arr);
$tpl = get_markup_template('common_tabs.tpl');
diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php
index d92335ad13..e5388154fe 100644
--- a/mod/nodeinfo.php
+++ b/mod/nodeinfo.php
@@ -6,11 +6,10 @@
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
-require_once 'include/plugin.php';
-
function nodeinfo_wellknown(App $a) {
$nodeinfo = ['links' => [['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
'href' => System::baseUrl().'/nodeinfo/1.0']]];
@@ -72,48 +71,48 @@ function nodeinfo_init(App $a) {
$nodeinfo['usage']['localPosts'] = (int)Config::get('nodeinfo', 'local_posts');
$nodeinfo['usage']['localComments'] = (int)Config::get('nodeinfo', 'local_comments');
- if (plugin_enabled('appnet')) {
+ if (Addon::isEnabled('appnet')) {
$nodeinfo['services']['inbound'][] = 'appnet';
}
- if (plugin_enabled('appnet') || plugin_enabled('buffer')) {
+ if (Addon::isEnabled('appnet') || Addon::isEnabled('buffer')) {
$nodeinfo['services']['outbound'][] = 'appnet';
}
- if (plugin_enabled('blogger')) {
+ if (Addon::isEnabled('blogger')) {
$nodeinfo['services']['outbound'][] = 'blogger';
}
- if (plugin_enabled('dwpost')) {
+ if (Addon::isEnabled('dwpost')) {
$nodeinfo['services']['outbound'][] = 'dreamwidth';
}
- if (plugin_enabled('fbpost') || plugin_enabled('buffer')) {
+ if (Addon::isEnabled('fbpost') || Addon::isEnabled('buffer')) {
$nodeinfo['services']['outbound'][] = 'facebook';
}
- if (plugin_enabled('statusnet')) {
+ if (Addon::isEnabled('statusnet')) {
$nodeinfo['services']['inbound'][] = 'gnusocial';
$nodeinfo['services']['outbound'][] = 'gnusocial';
}
- if (plugin_enabled('gpluspost') || plugin_enabled('buffer')) {
+ if (Addon::isEnabled('gpluspost') || Addon::isEnabled('buffer')) {
$nodeinfo['services']['outbound'][] = 'google';
}
- if (plugin_enabled('ijpost')) {
+ if (Addon::isEnabled('ijpost')) {
$nodeinfo['services']['outbound'][] = 'insanejournal';
}
- if (plugin_enabled('libertree')) {
+ if (Addon::isEnabled('libertree')) {
$nodeinfo['services']['outbound'][] = 'libertree';
}
- if (plugin_enabled('buffer')) {
+ if (Addon::isEnabled('buffer')) {
$nodeinfo['services']['outbound'][] = 'linkedin';
}
- if (plugin_enabled('ljpost')) {
+ if (Addon::isEnabled('ljpost')) {
$nodeinfo['services']['outbound'][] = 'livejournal';
}
- if (plugin_enabled('buffer')) {
+ if (Addon::isEnabled('buffer')) {
$nodeinfo['services']['outbound'][] = 'pinterest';
}
- if (plugin_enabled('posterous')) {
+ if (Addon::isEnabled('posterous')) {
$nodeinfo['services']['outbound'][] = 'posterous';
}
- if (plugin_enabled('pumpio')) {
+ if (Addon::isEnabled('pumpio')) {
$nodeinfo['services']['inbound'][] = 'pumpio';
$nodeinfo['services']['outbound'][] = 'pumpio';
}
@@ -121,13 +120,13 @@ function nodeinfo_init(App $a) {
if ($smtp) {
$nodeinfo['services']['outbound'][] = 'smtp';
}
- if (plugin_enabled('tumblr')) {
+ if (Addon::isEnabled('tumblr')) {
$nodeinfo['services']['outbound'][] = 'tumblr';
}
- if (plugin_enabled('twitter') || plugin_enabled('buffer')) {
+ if (Addon::isEnabled('twitter') || Addon::isEnabled('buffer')) {
$nodeinfo['services']['outbound'][] = 'twitter';
}
- if (plugin_enabled('wppost')) {
+ if (Addon::isEnabled('wppost')) {
$nodeinfo['services']['outbound'][] = 'wordpress';
}
$nodeinfo['metadata']['protocols'] = $nodeinfo['protocols'];
@@ -137,7 +136,7 @@ function nodeinfo_init(App $a) {
$nodeinfo['metadata']['services'] = $nodeinfo['services'];
- if (plugin_enabled('twitter')) {
+ if (Addon::isEnabled('twitter')) {
$nodeinfo['metadata']['services']['inbound'][] = 'twitter';
}
}
@@ -154,7 +153,7 @@ function nodeinfo_cron() {
$a = get_app();
// If the plugin 'statistics_json' is enabled then disable it and actrivate nodeinfo.
- if (plugin_enabled('statistics_json')) {
+ if (Addon::isEnabled('statistics_json')) {
Config::set('system', 'nodeinfo', true);
$plugin = 'statistics_json';
@@ -167,7 +166,7 @@ function nodeinfo_cron() {
$idx = array_search($plugin, $plugins_arr);
if ($idx !== false) {
unset($plugins_arr[$idx]);
- uninstall_plugin($plugin);
+ Addon::uninstall($plugin);
Config::set('system', 'addon', implode(', ',$plugins_arr));
}
}
diff --git a/mod/parse_url.php b/mod/parse_url.php
index dbe45aba15..6fb404f1b0 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -11,6 +11,7 @@
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Util\ParseUrl;
require_once("include/items.php");
@@ -91,7 +92,7 @@ function parse_url_content(App $a) {
$arr = ["url" => $url, "text" => ""];
- call_hooks("parse_link", $arr);
+ Addon::callHooks("parse_link", $arr);
if (strlen($arr["text"])) {
echo $arr["text"];
diff --git a/mod/photos.php b/mod/photos.php
index 6183ed60b6..3cb75e539c 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@@ -720,7 +721,7 @@ function photos_post(App $a)
// default post action - upload a photo
- call_hooks('photo_post_init', $_POST);
+ Addon::callHooks('photo_post_init', $_POST);
// Determine the album to use
$album = x($_REQUEST, 'album') ? notags(trim($_REQUEST['album'])) : '';
@@ -770,7 +771,7 @@ function photos_post(App $a)
$ret = ['src' => '', 'filename' => '', 'filesize' => 0, 'type' => ''];
- call_hooks('photo_post_file', $ret);
+ Addon::callHooks('photo_post_file', $ret);
if (x($ret, 'src') && x($ret, 'filesize')) {
$src = $ret['src'];
@@ -808,7 +809,7 @@ function photos_post(App $a)
}
@unlink($src);
$foo = 0;
- call_hooks('photo_post_end', $foo);
+ Addon::callHooks('photo_post_end', $foo);
return;
}
@@ -824,7 +825,7 @@ function photos_post(App $a)
notice(t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
@unlink($src);
$foo = 0;
- call_hooks('photo_post_end', $foo);
+ Addon::callHooks('photo_post_end', $foo);
return;
}
@@ -832,7 +833,7 @@ function photos_post(App $a)
notice(t('Image file is empty.') . EOL);
@unlink($src);
$foo = 0;
- call_hooks('photo_post_end', $foo);
+ Addon::callHooks('photo_post_end', $foo);
return;
}
@@ -847,7 +848,7 @@ function photos_post(App $a)
notice(t('Unable to process image.') . EOL);
@unlink($src);
$foo = 0;
- call_hooks('photo_post_end',$foo);
+ Addon::callHooks('photo_post_end',$foo);
killme();
}
@@ -937,7 +938,7 @@ function photos_post(App $a)
Worker::add(PRIORITY_HIGH, "Notifier", 'wall-new', $item_id);
}
- call_hooks('photo_post_end', intval($item_id));
+ Addon::callHooks('photo_post_end', intval($item_id));
// addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook
// if they do not wish to be redirected
@@ -1103,7 +1104,7 @@ function photos_content(App $a)
'addon_text' => $uploader,
'default_upload' => true];
- call_hooks('photo_upload_form',$ret);
+ Addon::callHooks('photo_upload_form',$ret);
$default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), []);
$default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), [
diff --git a/mod/ping.php b/mod/ping.php
index 9dd6780d01..6e11e18cd6 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
+use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\PConfig;
@@ -138,7 +139,7 @@ function ping_init(App $a)
if (DBM::is_result($items_unseen)) {
$arr = ['items' => $items_unseen];
- call_hooks('network_ping', $arr);
+ Addon::callHooks('network_ping', $arr);
foreach ($items_unseen as $item) {
if ($item['wall']) {
diff --git a/mod/poke.php b/mod/poke.php
index a8410b17d2..74348f84a7 100644
--- a/mod/poke.php
+++ b/mod/poke.php
@@ -15,6 +15,7 @@
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -142,7 +143,7 @@ function poke_init(App $a) {
}
- call_hooks('post_local_end', $arr);
+ Addon::callHooks('post_local_end', $arr);
Worker::add(PRIORITY_HIGH, "Notifier", "like", $post_id);
diff --git a/mod/profile.php b/mod/profile.php
index 4b1d4d2a0a..081b5e3a85 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Content\Nav;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@@ -180,7 +181,7 @@ function profile_content(App $a, $update = 0)
if ($tab === 'profile') {
$o .= Profile::getAdvanced($a);
- call_hooks('profile_advanced', $o);
+ Addon::callHooks('profile_advanced', $o);
return $o;
}
diff --git a/mod/profiles.php b/mod/profiles.php
index 32ed24346f..4cb9533093 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@@ -178,7 +179,7 @@ function profiles_post(App $a) {
$namechanged = false;
- call_hooks('profile_post', $_POST);
+ Addon::callHooks('profile_post', $_POST);
if (($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
$orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@@ -743,7 +744,7 @@ function profiles_content(App $a) {
]);
$arr = ['profile' => $r[0], 'entry' => $o];
- call_hooks('profile_edit', $arr);
+ Addon::callHooks('profile_edit', $arr);
return $o;
} else {
diff --git a/mod/register.php b/mod/register.php
index 56d4e59360..2bd09aca92 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -1,6 +1,7 @@
$_POST];
- call_hooks('register_post', $arr);
+ Addon::callHooks('register_post', $arr);
$max_dailies = intval(Config::get('system', 'max_daily_registrations'));
if ($max_dailies) {
@@ -241,7 +242,7 @@ function register_content(App $a)
$arr = ['template' => $tpl];
- call_hooks('register_form', $arr);
+ Addon::callHooks('register_form', $arr);
$tpl = $arr['template'];
diff --git a/mod/settings.php b/mod/settings.php
index 572857a48b..dd863cc19b 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
+use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Core\Config;
@@ -195,7 +196,7 @@ function settings_post(App $a)
if (($a->argc > 1) && ($a->argv[1] == 'addon')) {
check_form_security_token_redirectOnErr('/settings/addon', 'settings_addon');
- call_hooks('plugin_settings_post', $_POST);
+ Addon::callHooks('plugin_settings_post', $_POST);
return;
}
@@ -277,7 +278,7 @@ function settings_post(App $a)
}
}
- call_hooks('connector_settings_post', $_POST);
+ Addon::callHooks('connector_settings_post', $_POST);
return;
}
@@ -351,7 +352,7 @@ function settings_post(App $a)
intval(local_user())
);
- call_hooks('display_settings_post', $_POST);
+ Addon::callHooks('display_settings_post', $_POST);
goaway('settings/display');
return; // NOTREACHED
}
@@ -364,7 +365,7 @@ function settings_post(App $a)
goaway('settings');
}
- call_hooks('settings_post', $_POST);
+ Addon::callHooks('settings_post', $_POST);
if (x($_POST, 'password') || x($_POST, 'confirm')) {
$newpass = $_POST['password'];
@@ -753,7 +754,7 @@ function settings_content(App $a)
$settings_addons = t('No Plugin settings configured');
}
- call_hooks('plugin_settings', $settings_addons);
+ Addon::callHooks('plugin_settings', $settings_addons);
$tpl = get_markup_template('settings/addons.tpl');
@@ -799,7 +800,7 @@ function settings_content(App $a)
}
$settings_connectors = '';
- call_hooks('connector_settings', $settings_connectors);
+ Addon::callHooks('connector_settings', $settings_connectors);
if (is_site_admin()) {
$diasp_enabled = t('Built-in support for %s connectivity is %s', t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? t('enabled') : t('disabled')));
@@ -871,7 +872,7 @@ function settings_content(App $a)
'$submit' => t('Save Settings'),
]);
- call_hooks('display_settings', $o);
+ Addon::callHooks('display_settings', $o);
return $o;
}
@@ -1284,7 +1285,7 @@ function settings_content(App $a)
]);
- call_hooks('settings_form', $o);
+ Addon::callHooks('settings_form', $o);
$o .= '' . "\r\n";
diff --git a/mod/statistics_json.php b/mod/statistics_json.php
index 21eb10ab48..94a7fc9e1c 100644
--- a/mod/statistics_json.php
+++ b/mod/statistics_json.php
@@ -5,6 +5,7 @@
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
require_once("include/plugin.php");
@@ -28,19 +29,19 @@ function statistics_json_init(App $a) {
];
$statistics["services"] = [];
- $statistics["services"]["appnet"] = plugin_enabled("appnet");
- $statistics["services"]["blogger"] = plugin_enabled("blogger");
- $statistics["services"]["buffer"] = plugin_enabled("buffer");
- $statistics["services"]["dreamwidth"] = plugin_enabled("dwpost");
- $statistics["services"]["facebook"] = plugin_enabled("fbpost");
- $statistics["services"]["gnusocial"] = plugin_enabled("statusnet");
- $statistics["services"]["googleplus"] = plugin_enabled("gpluspost");
- $statistics["services"]["libertree"] = plugin_enabled("libertree");
- $statistics["services"]["livejournal"] = plugin_enabled("ljpost");
- $statistics["services"]["pumpio"] = plugin_enabled("pumpio");
- $statistics["services"]["twitter"] = plugin_enabled("twitter");
- $statistics["services"]["tumblr"] = plugin_enabled("tumblr");
- $statistics["services"]["wordpress"] = plugin_enabled("wppost");
+ $statistics["services"]["appnet"] = Addon::isEnabled("appnet");
+ $statistics["services"]["blogger"] = Addon::isEnabled("blogger");
+ $statistics["services"]["buffer"] = Addon::isEnabled("buffer");
+ $statistics["services"]["dreamwidth"] = Addon::isEnabled("dwpost");
+ $statistics["services"]["facebook"] = Addon::isEnabled("fbpost");
+ $statistics["services"]["gnusocial"] = Addon::isEnabled("statusnet");
+ $statistics["services"]["googleplus"] = Addon::isEnabled("gpluspost");
+ $statistics["services"]["libertree"] = Addon::isEnabled("libertree");
+ $statistics["services"]["livejournal"] = Addon::isEnabled("ljpost");
+ $statistics["services"]["pumpio"] = Addon::isEnabled("pumpio");
+ $statistics["services"]["twitter"] = Addon::isEnabled("twitter");
+ $statistics["services"]["tumblr"] = Addon::isEnabled("tumblr");
+ $statistics["services"]["wordpress"] = Addon::isEnabled("wppost");
$statistics["appnet"] = $statistics["services"]["appnet"];
$statistics["blogger"] = $statistics["services"]["blogger"];
diff --git a/mod/subthread.php b/mod/subthread.php
index 037e2982e7..af7f0b4921 100644
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -1,6 +1,7 @@
$r, 'xml' => $o];
- call_hooks('personal_xrd', $arr);
+ Addon::callHooks('personal_xrd', $arr);
echo $arr['xml'];
killme();
diff --git a/scripts/worker.php b/scripts/worker.php
index ccf24b7b43..a821fc1abe 100755
--- a/scripts/worker.php
+++ b/scripts/worker.php
@@ -6,6 +6,7 @@
*/
use Friendica\App;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@@ -42,7 +43,7 @@ if (Config::get('system', 'maintenance', true)) {
$a->set_baseurl(Config::get('system', 'url'));
-load_hooks();
+Addon::loadHooks();
$spawn = (($_SERVER["argc"] == 2) && ($_SERVER["argv"][1] == "spawn"));
diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php
index 4eb2e74aa2..fcaafb898c 100644
--- a/src/Content/ContactSelector.php
+++ b/src/Content/ContactSelector.php
@@ -4,6 +4,7 @@
*/
namespace Friendica\Content;
+use Friendica\Core\Addon;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use dba;
@@ -93,7 +94,7 @@ class ContactSelector
NETWORK_APPNET => t('App.net')
];
- call_hooks('network_to_name', $nets);
+ Addon::callHooks('network_to_name', $nets);
$search = array_keys($nets);
$replace = array_values($nets);
@@ -122,7 +123,7 @@ class ContactSelector
$o = '';
$select = ['', t('Male'), t('Female'), t('Currently Male'), t('Currently Female'), t('Mostly Male'), t('Mostly Female'), t('Transgender'), t('Intersex'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Non-specific'), t('Other'), t('Undecided')];
- call_hooks('gender_selector', $select);
+ Addon::callHooks('gender_selector', $select);
$o .= "
' . PHP_EOL;
- $visible_plugins = [];
- if (is_array($a->plugins) && count($a->plugins)) {
+ $visible_addons = [];
+ if (is_array($a->addons) && count($a->addons)) {
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
if (DBM::is_result($r)) {
foreach($r as $rr) {
- $visible_plugins[] = $rr['name'];
+ $visible_addons[] = $rr['name'];
}
}
}
- if (count($visible_plugins)) {
- $o .= '
' . PHP_EOL;
}
$blocklist = Config::get('system', 'blocklist');
diff --git a/mod/item.php b/mod/item.php
index ef4bf8dbce..a032e34989 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -731,7 +731,7 @@ function item_post(App $a) {
$datarray['object'] = $object;
/*
- * These fields are for the convenience of plugins...
+ * These fields are for the convenience of addons...
* 'self' if true indicates the owner is posting on their own wall
* If parent is 0 it is a top-level post.
*/
@@ -776,7 +776,7 @@ function item_post(App $a) {
Addon::callHooks('post_local',$datarray);
if (x($datarray, 'cancel')) {
- logger('mod_item: post cancelled by plugin.');
+ logger('mod_item: post cancelled by addon.');
if ($return_path) {
goaway($return_path);
}
diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php
index e5388154fe..bcaf8e7a93 100644
--- a/mod/nodeinfo.php
+++ b/mod/nodeinfo.php
@@ -152,22 +152,22 @@ function nodeinfo_cron() {
$a = get_app();
- // If the plugin 'statistics_json' is enabled then disable it and actrivate nodeinfo.
+ // If the addon 'statistics_json' is enabled then disable it and actrivate nodeinfo.
if (Addon::isEnabled('statistics_json')) {
Config::set('system', 'nodeinfo', true);
- $plugin = 'statistics_json';
- $plugins = Config::get('system', 'addon');
- $plugins_arr = [];
+ $addon = 'statistics_json';
+ $addons = Config::get('system', 'addon');
+ $addons_arr = [];
- if ($plugins) {
- $plugins_arr = explode(',',str_replace(' ', '',$plugins));
+ if ($addons) {
+ $addons_arr = explode(',',str_replace(' ', '',$addons));
- $idx = array_search($plugin, $plugins_arr);
+ $idx = array_search($addon, $addons_arr);
if ($idx !== false) {
- unset($plugins_arr[$idx]);
- Addon::uninstall($plugin);
- Config::set('system', 'addon', implode(', ',$plugins_arr));
+ unset($addons_arr[$idx]);
+ Addon::uninstall($addon);
+ Config::set('system', 'addon', implode(', ',$addons_arr));
}
}
}
diff --git a/mod/poke.php b/mod/poke.php
index 74348f84a7..48eeec85a2 100644
--- a/mod/poke.php
+++ b/mod/poke.php
@@ -7,7 +7,7 @@
* If the required arguments aren't present, we'll display a simple form to choose a recipient and a verb.
* parent is a special argument which let's you attach this activity as a comment to an existing conversation, which
* may have started with somebody else poking (etc.) somebody, but this isn't necessary. This can be used in the more pokes
- * plugin version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.
+ * addon version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.
*
* private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
*
diff --git a/mod/settings.php b/mod/settings.php
index dd863cc19b..c067f3db19 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -77,7 +77,7 @@ function settings_init(App $a)
];
$tabs[] = [
- 'label' => t('Plugins'),
+ 'label' => t('Addons'),
'url' => 'settings/addon',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
'accesskey' => 'l',
@@ -751,7 +751,7 @@ function settings_content(App $a)
$r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
if (!DBM::is_result($r)) {
- $settings_addons = t('No Plugin settings configured');
+ $settings_addons = t('No Addon settings configured');
}
Addon::callHooks('plugin_settings', $settings_addons);
@@ -760,7 +760,7 @@ function settings_content(App $a)
$tpl = get_markup_template('settings/addons.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_addon"),
- '$title' => t('Plugin Settings'),
+ '$title' => t('Addon Settings'),
'$settings_addons' => $settings_addons
]);
return $o;
diff --git a/src/App.php b/src/App.php
index ae914ba605..2a134a9c17 100644
--- a/src/App.php
+++ b/src/App.php
@@ -56,8 +56,8 @@ class App
public $hooks;
public $timezone;
public $interactive = true;
- public $plugins;
- public $plugins_admin = [];
+ public $addons;
+ public $addons_admin = [];
public $apps = [];
public $identities;
public $is_mobile = false;
diff --git a/src/Model/GContact.php b/src/Model/GContact.php
index 8e78dc68fd..d125ff8fe2 100644
--- a/src/Model/GContact.php
+++ b/src/Model/GContact.php
@@ -969,7 +969,7 @@ class GContact
/**
* @brief Fetches users of given GNU Social server
*
- * If the "Statistics" plugin is enabled (See http://gstools.org/ for details) we query user data with this.
+ * If the "Statistics" addon is enabled (See http://gstools.org/ for details) we query user data with this.
*
* @param string $server Server address
* @return void
diff --git a/src/Model/User.php b/src/Model/User.php
index e8fdb4d040..862a9d4084 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -390,7 +390,7 @@ class User
$photo = avatar_img($email);
}
- // unless there is no avatar-plugin loaded
+ // unless there is no avatar-addon loaded
if (strlen($photo)) {
$photo_failure = false;
diff --git a/src/Module/Login.php b/src/Module/Login.php
index 1da7a7417a..d238883269 100644
--- a/src/Module/Login.php
+++ b/src/Module/Login.php
@@ -89,9 +89,9 @@ class Login extends BaseModule
];
/*
- * A plugin indicates successful login by setting 'authenticated' to non-zero value and returning a user record
- * Plugins should never set 'authenticated' except to indicate success - as hooks may be chained
- * and later plugins should not interfere with an earlier one that succeeded.
+ * An addon indicates successful login by setting 'authenticated' to non-zero value and returning a user record
+ * Addons should never set 'authenticated' except to indicate success - as hooks may be chained
+ * and later addons should not interfere with an earlier one that succeeded.
*/
Addon::callHooks('authenticate', $addon_auth);
diff --git a/src/Object/Post.php b/src/Object/Post.php
index 7136df5535..59258a0aec 100644
--- a/src/Object/Post.php
+++ b/src/Object/Post.php
@@ -759,10 +759,10 @@ class Post extends BaseObject
$qc = $qcomment = null;
/*
- * Hmmm, code depending on the presence of a particular plugin?
+ * Hmmm, code depending on the presence of a particular addon?
* This should be better if done by a hook
*/
- if (in_array('qcomment', $a->plugins)) {
+ if (in_array('qcomment', $a->addons)) {
$qc = ((local_user()) ? PConfig::get(local_user(), 'qcomment', 'words') : null);
$qcomment = (($qc) ? explode("\n", $qc) : null);
}
diff --git a/update.php b/update.php
index ff0885229d..3cfc39e192 100644
--- a/update.php
+++ b/update.php
@@ -85,21 +85,21 @@ function update_1191() {
Config::set('system', 'maintenance', 1);
if (Addon::isEnabled('forumlist')) {
- $plugin = 'forumlist';
- $plugins = Config::get('system','addon');
- $plugins_arr = [];
+ $addon = 'forumlist';
+ $addons = Config::get('system', 'addon');
+ $addons_arr = [];
- if ($plugins) {
- $plugins_arr = explode(",",str_replace(" ", "",$plugins));
+ if ($addons) {
+ $addons_arr = explode(",",str_replace(" ", "", $addons));
- $idx = array_search($plugin, $plugins_arr);
+ $idx = array_search($addon, $addons_arr);
if ($idx !== false){
- unset($plugins_arr[$idx]);
+ unset($addons_arr[$idx]);
//delete forumlist manually from addon and hook table
// since Addon::uninstall() don't work here
q("DELETE FROM `addon` WHERE `name` = 'forumlist' ");
q("DELETE FROM `hook` WHERE `file` = 'addon/forumlist/forumlist.php' ");
- Config::set('system','addon', implode(", ",$plugins_arr));
+ Config::set('system','addon', implode(", ", $addons_arr));
}
}
}
diff --git a/util/strings.php b/util/strings.php
index 2b6e39cdc1..eb6471ec21 100644
--- a/util/strings.php
+++ b/util/strings.php
@@ -386,12 +386,12 @@ $a->strings["Contacts who are not members of a group"] = "";
$a->strings["Theme settings updated."] = "";
$a->strings["Site"] = "";
$a->strings["Users"] = "";
-$a->strings["Plugins"] = "";
+$a->strings["Addons"] = "";
$a->strings["Themes"] = "";
$a->strings["DB updates"] = "";
$a->strings["Logs"] = "";
$a->strings["Admin"] = "";
-$a->strings["Plugin Features"] = "";
+$a->strings["Addon Features"] = "";
$a->strings["User registrations waiting for confirmation"] = "";
$a->strings["Normal Account"] = "";
$a->strings["Soapbox Account"] = "";
@@ -405,7 +405,7 @@ $a->strings["Summary"] = "";
$a->strings["Registered users"] = "";
$a->strings["Pending registrations"] = "";
$a->strings["Version"] = "";
-$a->strings["Active plugins"] = "";
+$a->strings["Active addons"] = "";
$a->strings["Can not parse base url. Must have at least ://"] = "";
$a->strings["Site settings updated."] = "";
$a->strings["No special theme for mobile devices"] = "";
@@ -579,8 +579,8 @@ $a->strings["Name of the new user."] = "";
$a->strings["Nickname"] = "";
$a->strings["Nickname of the new user."] = "";
$a->strings["Email address of the new user."] = "";
-$a->strings["Plugin %s disabled."] = "";
-$a->strings["Plugin %s enabled."] = "";
+$a->strings["Addon %s disabled."] = "";
+$a->strings["Addon %s enabled."] = "";
$a->strings["Disable"] = "";
$a->strings["Enable"] = "";
$a->strings["Toggle"] = "";
@@ -812,8 +812,8 @@ $a->strings["Connected Apps"] = "";
$a->strings["Client key starts with"] = "";
$a->strings["No name"] = "";
$a->strings["Remove authorization"] = "";
-$a->strings["No Plugin settings configured"] = "";
-$a->strings["Plugin Settings"] = "";
+$a->strings["No Addon settings configured"] = "";
+$a->strings["Addon Settings"] = "";
$a->strings["Off"] = "";
$a->strings["On"] = "";
$a->strings["Additional Features"] = "";
@@ -1128,8 +1128,8 @@ $a->strings["running at web location"] = "";
$a->strings["Please visit Friendica.com to learn more about the Friendica project."] = "";
$a->strings["Bug reports and issues: please visit"] = "";
$a->strings["Suggestions, praise, donations, etc. - please email \"Info\" at Friendica - dot com"] = "";
-$a->strings["Installed plugins/addons/apps:"] = "";
-$a->strings["No installed plugins/addons/apps"] = "";
+$a->strings["Installed addons/addons/apps:"] = "";
+$a->strings["No installed addons/addons/apps"] = "";
$a->strings["Authorize application connection"] = "";
$a->strings["Return to your app and insert this Securty Code:"] = "";
$a->strings["Please login to continue."] = "";
diff --git a/view/templates/admin/aside.tpl b/view/templates/admin/aside.tpl
index 5c9cce0d0c..0049394bae 100644
--- a/view/templates/admin/aside.tpl
+++ b/view/templates/admin/aside.tpl
@@ -26,9 +26,9 @@
{{/if}}
-{{if $admin.plugins_admin}}
{{$plugadmtxt}}
{{/if}}
+{{if $admin.addons_admin}}
{{$plugadmtxt}}
{{/if}}
- {{foreach $admin.plugins_admin as $l}}
+ {{foreach $admin.addons_admin as $l}}
From 20a16b0b357bee5fdf8947e7bc8e3b36540f22f4 Mon Sep 17 00:00:00 2001
From: Adam Magness
Date: Wed, 17 Jan 2018 19:07:07 -0500
Subject: [PATCH 07/12] Update docs
changelog, install and doc folder
---
CHANGELOG | 4 +--
INSTALL.txt | 12 +++----
README.md | 2 +-
doc/Accesskeys.md | 2 +-
doc/Chats.md | 16 ++++-----
doc/Composer.md | 2 +-
doc/FAQ.md | 2 +-
doc/Home.md | 2 +-
doc/Improve-Performance.md | 6 ++--
doc/Installing-Connectors.md | 18 +++++-----
doc/Plugins.md | 62 +++++++++++++++------------------
doc/Settings.md | 10 +++---
doc/database.md | 4 +--
doc/database/db_addon.md | 4 +--
doc/de/Chats.md | 12 +++----
doc/de/FAQ.md | 2 +-
doc/de/Home.md | 4 +--
doc/de/Improve-Performance.md | 6 ++--
doc/de/Installing-Connectors.md | 20 +++++------
doc/de/Plugins.md | 48 ++++++++++++-------------
doc/de/Settings.md | 8 ++---
21 files changed, 119 insertions(+), 127 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index e9b5cae857..9ad9137714 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -299,7 +299,7 @@ Version 3.4.3 (2015-12-22)
Contact's posts are shown in a dedicated page (annando)
Module name is shown in page title to ease browser history navigation (issue #2079) (tobiasd)
What's new for admins:
- Forumlist functionality moved from plugin to core (rabuzarus, annando)
+ Forumlist functionality moved from addon to core (rabuzarus, annando)
Changes on poller/workers limits management (annando)
Diaspora and OStatus can be enabled only if requirements are satisfied (annando)
Support for additional passwords for ejabberd (annando)
@@ -380,7 +380,7 @@ Version 3.4.2 (2015-09-29)
Support for inline [code] tag usage (fabrixxm)
Fix login form in aside (issue #1348) (annando)
Show both url-style and webfinger-style identity address in profile (issue #1621) (tobiasd)
- Add button to reload all active plugins in admin plugins page to ensure new hooks are used (fabrixxm)
+ Add button to reload all active addons in admin addons page to ensure new hooks are used (fabrixxm)
Make the hardcoded path to global directory configurable (annando)
Change default directory to dir.friendi.ca (annando)
Improve cache system with granular expire time (annando)
diff --git a/INSTALL.txt b/INSTALL.txt
index eaf7604e3e..5dee845677 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -130,18 +130,18 @@ You should also be sure that $a->config['php_path'] is set correctly, it should
look like (changing it to the correct PHP location)
$a->config['php_path'] = '/usr/local/php53/bin/php'
-
-Alternative: You may be able to use the 'poormancron' plugin to perform this
+
+Alternative: You may be able to use the 'poormancron' addon to perform this
step if you are using a recent Friendica release. 'poormancron' may result in
perfomance and memory issues and is only suitable for small sites with one or
-two users and a handful of contacts. To do this, edit the file
-".htconfig.php" and look for a line describing your plugins. On a fresh
+two users and a handful of contacts. To do this, edit the file
+".htconfig.php" and look for a line describing your addons. On a fresh
installation, it will look like
$a->config['system']['addon'] = 'js_upload';
-This indicates the "js_upload" addon module is enabled. You may add additional
-addons/plugins using this same line in the configuration file. Change it to
+This indicates the "js_upload" addon module is enabled. You may add additional
+addons/addons using this same line in the configuration file. Change it to
read
$a->config['system']['addon'] = 'js_upload,poormancron';
diff --git a/README.md b/README.md
index 4e627ef2d3..20d6b0ef50 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Our mission is to free friends, family and colleagues from data-harvesting corpo
Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on [Friendica]( https://friendi.ca), [Mastodon](https://joinmastodon.org/), [Diaspora](https://diasporafoundation.org/), [GnuSocial](https://gnu.io/social/), [Pleroma](https://pleroma.social/), or [Hubzilla](https://hubzilla.org/), regardless where each user profile is hosted.
-With Friendica, you can also fully interact with anyone on Twitter, post on Facebook and receive any content on Tumblr, Wordpress or RSS. Friendica allows you to integrate most things on the web via a range of plugins such as ITTT, Buffer; you will be able to easily control your own data as you decide.
+With Friendica, you can also fully interact with anyone on Twitter, post on Facebook and receive any content on Tumblr, Wordpress or RSS. Friendica allows you to integrate most things on the web via a range of addons such as ITTT, Buffer; you will be able to easily control your own data as you decide.
Join today and [get your Friendica profile!](https://dir.friendica.social/servers 'Join Friendica today!')
diff --git a/doc/Accesskeys.md b/doc/Accesskeys.md
index 3369f9afd9..b9e5f5430a 100644
--- a/doc/Accesskeys.md
+++ b/doc/Accesskeys.md
@@ -69,7 +69,7 @@ General
* o: Account
* t: Additional features
* w: Social Networks
-* l: Plugins
+* l: Addons
* d: Delegations
* b: Connected apps
* e: Export personal data
diff --git a/doc/Chats.md b/doc/Chats.md
index 4e392f8d8f..b7557944f3 100644
--- a/doc/Chats.md
+++ b/doc/Chats.md
@@ -8,10 +8,10 @@ There are two possibilities to use chat on your friendica site
* IRC Chat
* Jappix
-IRC-Chat Plugin
+IRC-Chat Addon
---
-After activating the plugin, you can find the chat at [yoursite.com/irc](../irc).
+After activating the addon, you can find the chat at [yoursite.com/irc](../irc).
Note: you can use this chat without any login at your site so that everyone could use it.
If you follow the link, you will see the login page of the IRC chat.
@@ -28,8 +28,8 @@ The lower part of the window contains an input field.
Jappix Mini
---
-The Jappix Mini Plugin creates a chatbox for jabber- and XMPP-contacts.
-You should already have a jabber/XMPP-account before setting up the plugin.
+The Jappix Mini Addon creates a chatbox for jabber- and XMPP-contacts.
+You should already have a jabber/XMPP-account before setting up the addon.
You can find more information at [jabber.org](http://www.jabber.org/).
You can use several servers to create an account:
@@ -48,15 +48,15 @@ Or you can download a tar archive here: [jappixmini.tgz](https://github.com/frie
Just unpack the file and rename the directory to „jappixmini“.
Next, upload this directory and the .tgz-file into your addon directory of your friendica installation.
-Now you can activate the plugin globally on the admin pages.
-In the plugin sidebar, you will find an entry of jappix now (where you can also find twitter, GNU Social and others).
-The following page shows the settings of this plugin.
+Now you can activate the addon globally on the admin pages.
+In the addon sidebar, you will find an entry of jappix now (where you can also find twitter, GNU Social and others).
+The following page shows the settings of this addon.
Activate the BOSH proxy.
###2. Settings
-Go to your user account settings next and choose the plugin page.
+Go to your user account settings next and choose the addon page.
Scroll down until you find the Jappix Mini addon settings.
At first you have to activate the addon.
diff --git a/doc/Composer.md b/doc/Composer.md
index 02ce61639c..41fc2aca37 100644
--- a/doc/Composer.md
+++ b/doc/Composer.md
@@ -55,7 +55,7 @@ If you don't need to use any third-party library, then you don't need to use Com
#### Adding a third-party library to Friendica
-Does your shiny new [Plugin](help/Plugins) need to rely on a third-party library not required by Friendica yet?
+Does your shiny new [Addon](help/Addons) need to rely on a third-party library not required by Friendica yet?
First of all, this library should be available on [Packagist](https://packagist.org) so that Composer knows how to fetch it directly just by mentioning its name in `composer.json`.
This file is the configuration of Friendica for Composer. It lists details about the Friendica project, but also a list of required dependencies and their target version.
diff --git a/doc/FAQ.md b/doc/FAQ.md
index fddc64abc0..ccf81d8a94 100644
--- a/doc/FAQ.md
+++ b/doc/FAQ.md
@@ -87,7 +87,7 @@ Blocked contacts cannot do this. They cannot communicate with you directly, only
However we do not import their posts or private messages to you.
Like blocking, you will still see this person's comments to posts made by your friends.
-A plugin called "blockem" can be installed to collapse/hide all posts from a particular person in your stream if you desire complete blocking of an individual, including his/her conversations with your other friends.
+An addon called "blockem" can be installed to collapse/hide all posts from a particular person in your stream if you desire complete blocking of an individual, including his/her conversations with your other friends.
An **archived contact** means that communication is not possible and will not be attempted.
(Perhaps the person moved to a new site and removed the old profile.)
diff --git a/doc/Home.md b/doc/Home.md
index 4f956e3c7a..0a1059d019 100644
--- a/doc/Home.md
+++ b/doc/Home.md
@@ -43,7 +43,7 @@ Friendica Documentation and Resources
* [Help on Vagrant](help/Vagrant)
* [Bugs and Issues](help/Bugs-and-Issues)
* Code structure
- * [Plugin Development](help/Plugins)
+ * [Addon Development](help/Addons)
* [Theme Development](help/themes)
* [Smarty 3 Templates](help/smarty3-templates)
* How To
diff --git a/doc/Improve-Performance.md b/doc/Improve-Performance.md
index 8c0529bd56..48ac9e798d 100644
--- a/doc/Improve-Performance.md
+++ b/doc/Improve-Performance.md
@@ -22,16 +22,16 @@ If you have many OStatus contacts then completing of conversations can take some
When using MyISAM (default) or InnoDB on MariaDB 10 this speeds up search.
-Plugins
+Addons
--------
-Active the following plugins:
+Active the following addons:
rendertime
###rendertime
-This plugin doesn't speed up your system.
+This addon doesn't speed up your system.
It helps to analyze your bottlenecks.
When enabled you see some values at the bottom of every page.
diff --git a/doc/Installing-Connectors.md b/doc/Installing-Connectors.md
index 34ade6b3be..1d83f07420 100644
--- a/doc/Installing-Connectors.md
+++ b/doc/Installing-Connectors.md
@@ -4,28 +4,28 @@ Installing Connectors (Twitter/GNU Social)
* [Home](help)
-Friendica uses plugins to provide connectivity to some networks, such as Twitter or App.net.
+Friendica uses addons to provide connectivity to some networks, such as Twitter or App.net.
-There is also a plugin to post through to an existing account on a GNU Social service.
+There is also a addon to post through to an existing account on a GNU Social service.
You only need this to post to an already existing GNU Social account, but not to communicate with GNU Social members in general.
-All three plugins require an account on the target network.
+All three addons require an account on the target network.
In addition you (or typically the server administrator) will need to obtain an API key to provide authenticated access to your Friendica server.
Site Configuration
---
-Plugins must be installed by the site administrator before they can be used.
+Addons must be installed by the site administrator before they can be used.
This is accomplished through the site administration panel.
Each of the connectors also requires an "API key" from the service you wish to connect with.
-Some plugins allow you to enter this information in the site administration pages, while others may require you to edit your configuration file (.htconfig.php).
+Some addons allow you to enter this information in the site administration pages, while others may require you to edit your configuration file (.htconfig.php).
The ways to obtain these keys vary between the services, but they all require an existing account on the target service.
Once installed, these API keys can usually be shared by all site members.
-The details of configuring each service follow (much of this information comes directly from the plugin source files):
+The details of configuring each service follow (much of this information comes directly from the addon source files):
-Twitter Plugin for Friendica
+Twitter Addon for Friendica
---
* Author: Tobias Diekershoff
@@ -33,7 +33,7 @@ Twitter Plugin for Friendica
* License: 3-clause BSD license
###Configuration
-To use this plugin you need a OAuth Consumer key pair (key & secret).
+To use this addon you need a OAuth Consumer key pair (key & secret).
You can get it from [Twitter](https://twitter.com/apps).
Register your Friendica site as "Client" application with "Read & Write" access.
@@ -51,7 +51,7 @@ After this, your users can configure their Twitter account settings from "Settin
Find the author's documentation here: [http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/Twitter_Plugin](http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/Twitter_Plugin)
-GNU Social Plugin for Friendica
+GNU Social Addon for Friendica
---
* Author: Tobias Diekershoff
diff --git a/doc/Plugins.md b/doc/Plugins.md
index 995e9184c7..4c2596ee6c 100644
--- a/doc/Plugins.md
+++ b/doc/Plugins.md
@@ -1,4 +1,4 @@
-Friendica Addon/Plugin development
+Friendica Addon development
==============
* [Home](help)
@@ -7,32 +7,32 @@ Please see the sample addon 'randplace' for a working example of using some of t
Addons work by intercepting event hooks - which must be registered.
Modules work by intercepting specific page requests (by URL path).
-Plugin names cannot contain spaces or other punctuation and are used as filenames and function names.
+Addon names cannot contain spaces or other punctuation and are used as filenames and function names.
You may supply a "friendly" name within the comment block.
-Each addon must contain both an install and an uninstall function based on the addon/plugin name.
-For instance "plugin1name_install()".
-These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your plugin will require.
-The install and uninstall functions will also be called (i.e. re-installed) if the plugin changes after installation.
+Each addon must contain both an install and an uninstall function based on the addon/addon name.
+For instance "addon1name_install()".
+These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your addon will require.
+The install and uninstall functions will also be called (i.e. re-installed) if the addon changes after installation.
Therefore your uninstall should not destroy data and install should consider that data may already exist.
Future extensions may provide for "setup" amd "remove".
-Plugins should contain a comment block with the four following parameters:
+Addons should contain a comment block with the four following parameters:
/*
- * Name: My Great Plugin
- * Description: This is what my plugin does. It's really cool.
+ * Name: My Great Addon
+ * Description: This is what my addon does. It's really cool.
* Version: 1.0
* Author: John Q. Public
*/
-Register your plugin hooks during installation.
+Register your addon hooks during installation.
Addon::registerHook($hookname, $file, $function);
$hookname is a string and corresponds to a known Friendica hook.
$file is a pathname relative to the top-level Friendica directory.
-This *should* be 'addon/plugin_name/plugin_name.php' in most cases.
+This *should* be 'addon/addon_name/addon_name.php' in most cases.
$function is a string and is the name of the function which will be executed when the hook is called.
@@ -69,39 +69,39 @@ Remember to declare it with '&' if you wish to alter it.
Modules
---
-Plugins/addons may also act as "modules" and intercept all page requests for a given URL path.
-In order for a plugin to act as a module it needs to define a function "plugin_name_module()" which takes no arguments and needs not do anything.
+Addons/addons may also act as "modules" and intercept all page requests for a given URL path.
+In order for a addon to act as a module it needs to define a function "addon_name_module()" which takes no arguments and needs not do anything.
-If this function exists, you will now receive all page requests for "http://my.web.site/plugin_name" - with any number of URL components as additional arguments.
+If this function exists, you will now receive all page requests for "http://my.web.site/addon_name" - with any number of URL components as additional arguments.
These are parsed into an array $a->argv, with a corresponding $a->argc indicating the number of URL components.
-So http://my.web.site/plugin/arg1/arg2 would look for a module named "plugin" and pass its module functions the $a App structure (which is available to many components).
+So http://my.web.site/addon/arg1/arg2 would look for a module named "addon" and pass its module functions the $a App structure (which is available to many components).
This will include:
$a->argc = 3
- $a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
+ $a->argv = array(0 => 'addon', 1 => 'arg1', 2 => 'arg2');
-Your module functions will often contain the function plugin_name_content(App $a), which defines and returns the page body content.
-They may also contain plugin_name_post(App $a) which is called before the _content function and typically handles the results of POST forms.
-You may also have plugin_name_init(App $a) which is called very early on and often does module initialisation.
+Your module functions will often contain the function addon_name_content(App $a), which defines and returns the page body content.
+They may also contain addon_name_post(App $a) which is called before the _content function and typically handles the results of POST forms.
+You may also have addon_name_init(App $a) which is called very early on and often does module initialisation.
Templates
---
-If your plugin needs some template, you can use the Friendica template system.
+If your addon needs some template, you can use the Friendica template system.
Friendica uses [smarty3](http://www.smarty.net/) as a template engine.
-Put your tpl files in the *templates/* subfolder of your plugin.
+Put your tpl files in the *templates/* subfolder of your addon.
-In your code, like in the function plugin_name_content(), load the template file and execute it passing needed values:
+In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
# load template file. first argument is the template name,
- # second is the plugin path relative to friendica top folder
- $tpl = get_markup_template('mytemplate.tpl', 'addon/plugin_name/');
+ # second is the addon path relative to friendica top folder
+ $tpl = get_markup_template('mytemplate.tpl', 'addon/addon_name/');
# apply template. first argument is the loaded template,
# second an array of 'name'=>'values' to pass to template
$output = replace_macros($tpl,array(
- 'title' => 'My beautiful plugin',
+ 'title' => 'My beautiful addon',
));
See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
@@ -151,11 +151,11 @@ $b is an array:
* called when the Settings pages are submitted
* $b is the $_POST array
-### 'plugin_settings'
+### 'addon_settings'
* called when generating the HTML for the addon settings page
* $b is the (string) HTML of the addon settings page before the final '' tag.
-### 'plugin_settings_post'
+### 'addon_settings_post'
* called when the Addon Settings pages are submitted
* $b is the $_POST array
@@ -394,10 +394,6 @@ include/conversation.php: Addon::callHooks('jot_tool', $jotplugins);
include/conversation.php: Addon::callHooks('jot_networks', $jotnets);
-include/plugin.php:if(! function_exists('call_hooks')) {
-
-include/plugin.php:function Addon::callHooks($name, &$data = null) {
-
index.php: Addon::callHooks('init_1');
index.php:Addon::callHooks('app_menu', $arr);
@@ -434,13 +430,13 @@ mod/contacts.php: Addon::callHooks('contact_edit_post', $_POST);
mod/contacts.php: Addon::callHooks('contact_edit', $arr);
-mod/settings.php: Addon::callHooks('plugin_settings_post', $_POST);
+mod/settings.php: Addon::callHooks('addon_settings_post', $_POST);
mod/settings.php: Addon::callHooks('connector_settings_post', $_POST);
mod/settings.php: Addon::callHooks('settings_post', $_POST);
-mod/settings.php: Addon::callHooks('plugin_settings', $settings_addons);
+mod/settings.php: Addon::callHooks('addon_settings', $settings_addons);
mod/settings.php: Addon::callHooks('connector_settings', $settings_connectors);
diff --git a/doc/Settings.md b/doc/Settings.md
index a0b33d76d2..a574e0675c 100644
--- a/doc/Settings.md
+++ b/doc/Settings.md
@@ -14,7 +14,7 @@ These worker tasks are prioritised and are done accordingly.
Then you get an overview of the accounts on your node, which can be moderated in the "Users" section of the panel.
As well as an overview of the currently active addons
-The list is linked, so you can have quick access to the plugin settings.
+The list is linked, so you can have quick access to the Addon settings.
And finally you are informed about the version of Friendica you have installed.
If you contact the devs with a bug or problem, please also mention the version of your node.
@@ -205,7 +205,7 @@ Here the admin can also block/unblock users from accessing the node or delete th
In the last section of the page admins can create new accounts on the node.
The password for the new account will be send by email to the choosen email address.
-## Plugins
+## Addons
This page is for selecting and configuration of extensions for Friendica which have to be placed into the `/addon` subdirectory of your Friendica installation.
You are presented with a long list of available addons.
@@ -213,11 +213,11 @@ The name of each addon is linked to a separate page for that addon which offers
Also shown is the version of the addon and an indicator if the addon is currently active or not.
When you update your node and the addons they may have to be reloaded.
-To simplify this process there is a button at the top of the page to reload all active plugins.
+To simplify this process there is a button at the top of the page to reload all active Addons.
## Themes
-The Themes section of the admin panel works similar to the Plugins section but let you control the themes on your Friendica node.
+The Themes section of the admin panel works similar to the Addons section but let you control the themes on your Friendica node.
Each theme has a dedicated subpage showing the current status, some information about the theme and a screen-shot of the Friendica interface using the theme.
Should the theme offer special settings, admins can set a global default value here.
@@ -266,7 +266,7 @@ To do so, they need to know the GUID of the posting.
This can be found on the `/display` page of the posting, it is the last part of the URL displayed in the browsers navigation bar.
You can get to the `/display` page by following the *Link to source*.
-## Plugin Features
+## Addon Features
Some of the addons you can install for your Friendica node have settings which have to be set by the admin.
All those addons will be listed in this area of the admin panels side bar with their names.
diff --git a/doc/database.md b/doc/database.md
index e778a0a721..b58fba9d98 100644
--- a/doc/database.md
+++ b/doc/database.md
@@ -5,7 +5,7 @@ Database Tables
| Table | Description |
|------------------------------------------------------|--------------------------------------------------|
-| [addon](help/database/db_addon) | registered plugins |
+| [addon](help/database/db_addon) | registered addons |
| [attach](help/database/db_attach) | file attachments |
| [auth_codes](help/database/db_auth_codes) | OAuth usage |
| [cache](help/database/db_cache) | OEmbed cache |
@@ -24,7 +24,7 @@ Database Tables
| [group](help/database/db_group) | privacy groups, group info |
| [group_member](help/database/db_group_member) | privacy groups, member info |
| [gserver](help/database/db_gserver) | |
-| [hook](help/database/db_hook) | plugin hook registry |
+| [hook](help/database/db_hook) | addon hook registry |
| [intro](help/database/db_intro) | |
| [item](help/database/db_item) | all posts |
| [locks](help/database/db_locks) | |
diff --git a/doc/database/db_addon.md b/doc/database/db_addon.md
index 099abbf642..eceb3b68b9 100644
--- a/doc/database/db_addon.md
+++ b/doc/database/db_addon.md
@@ -4,7 +4,7 @@ Table addon
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | --------------------------------------------- | ---------- | ---- | --- | ------- | --------------- |
| id | | int(11) | NO | PRI | NULL | auto_increment |
-| name | plugin base (file)name | char(255) | NO | | | |
+| name | addon base (file)name | char(255) | NO | | | |
| version | currently unused | char(255) | NO | | | |
| installed | currently always 1 | tinyint(1) | NO | | 0 | |
| hidden | currently unused | tinyint(1) | NO | | 0 | |
@@ -12,6 +12,6 @@ Table addon
| plugin_admin | 1 = has admin config, 0 = has no admin config | tinyint(1) | NO | | 0 | |
Notes:
-These are addons which have been enabled by the site administrator on the admin/plugin page
+These are addons which have been enabled by the site administrator on the admin/addon page
Return to [database documentation](help/database)
diff --git a/doc/de/Chats.md b/doc/de/Chats.md
index ae239a675b..fc46af650e 100644
--- a/doc/de/Chats.md
+++ b/doc/de/Chats.md
@@ -8,9 +8,9 @@ Du hast derzeit zwei Möglichkeiten, einen Chat auf Deiner Friendica-Seite zu be
* IRC - Internet Relay Chat
* Jappix
-##IRC Plugin
+##IRC Addon
-Sobald das Plugin aktiviert ist, kannst Du den Chat unter [deineSeite.de/irc](../irc) finden.
+Sobald das Addon aktiviert ist, kannst Du den Chat unter [deineSeite.de/irc](../irc) finden.
Beachte aber, dass dieser Chat auch ohne Anmeldung auf Deiner Seite zugänglich ist und somit auch Fremde diesen Chat mitnutzen können.
Wenn Du dem Link folgst, dann kommst Du zum Anmeldefenster des IR-Chats.
@@ -29,7 +29,7 @@ Weiter Informationen zu IRC findest Du zum Beispiel auf einfachjabber.de.
@@ -53,15 +53,15 @@ oder als normaler Download von hier: https://github.com/friendica/friendica-addo
Entpacke diese Datei (ggf. den entpackten Ordner in „jappixmini“ umbenennen) und lade sowohl den entpackten Ordner komplett als auch die .tgz Datei in den Addon Ordner Deiner Friendica Installation hoch.
-Nach dem Upload gehts in den Friendica Adminbereich und dort zu den Plugins.
-Aktiviere das Jappixmini Addon und gehe anschließend über die Plugins Seitenleiste (dort wo auch die Twitter-, Impressums-, GNU Social-, usw. Einstellungen gemacht werden) zu den Jappix Grundeinstellungen.
+Nach dem Upload gehts in den Friendica Adminbereich und dort zu den Addons.
+Aktiviere das Jappixmini Addon und gehe anschließend über die Addons Seitenleiste (dort wo auch die Twitter-, Impressums-, GNU Social-, usw. Einstellungen gemacht werden) zu den Jappix Grundeinstellungen.
Setze hier den Haken zur Aktivierung des BOSH Proxys.
Weiter gehts in den Einstellungen Deines Friendica Accounts.
2. Einstellungen
-Gehe bitte zu den Plugin-Einstellungen in Deinen Konto-Einstellungen (Account Settings).
+Gehe bitte zu den Addon-Einstellungen in Deinen Konto-Einstellungen (Account Settings).
Scrolle ein Stück hinunter bis zu den Jappix Mini Addon settings.
Aktiviere hier zuerst das Addon.
diff --git a/doc/de/FAQ.md b/doc/de/FAQ.md
index e78e8bc21a..aa9d01b64d 100644
--- a/doc/de/FAQ.md
+++ b/doc/de/FAQ.md
@@ -104,7 +104,7 @@ Ignorierte Kontakte können weiterhin Beiträge und private Nachrichten von Dir
Deren Beiträge und private Nachrichten werden allerdings nicht importiert.
Wie bei blockierten Beiträgen siehst Du auch hier weiterhin die Kommentare dieser Person zu anderen Beiträgen Deiner Freunde.
-[Ein Plugin namens "blockem" kann installiert werden, um alle Beiträge einer bestimmten Person in Deinem Stream zu verstecken bzw. zu verkürzen.
+[Ein Erweiterung namens "blockem" kann installiert werden, um alle Beiträge einer bestimmten Person in Deinem Stream zu verstecken bzw. zu verkürzen.
Dabei werden auch Kommentare dieser Person in Beiträgen Deiner Freunde blockiert.]
Ein archivierter Kontakt bedeutet, dass Kommunikation nicht möglich ist und auch nicht versucht wird (das ist z.B. sinnvoll, wenn eine Person zu einem neuen Server gewechselt ist und das alte Profil gelöscht hat).
diff --git a/doc/de/Home.md b/doc/de/Home.md
index 67ca15ebcd..403cc1477e 100644
--- a/doc/de/Home.md
+++ b/doc/de/Home.md
@@ -30,7 +30,7 @@ Friendica - Dokumentation und Ressourcen
* [Installation](help/Install)
* [Update](help/Update) (EN)
* [Konfigurationen & Admin-Panel](help/Settings)
-* [Plugins](help/Plugins)
+* [Addons](help/Addons)
* [Konnektoren (Connectors) installieren (Twitter/GNU Social)](help/Installing-Connectors)
* [Installation eines ejabberd Servers (XMPP-Chat) mit synchronisierten Anmeldedaten](help/install-ejabberd) (EN)
* [Betreibe deine Seite mit einem SSL-Zertifikat](help/SSL)
@@ -45,7 +45,7 @@ Friendica - Dokumentation und Ressourcen
* [Help on Vagrant](help/Vagrant)
* [How to translate Friendica](help/translations) (EN)
* [Bugs and Issues](help/Bugs-and-Issues)
-* [Plugin Development](help/Plugins)
+* [Addon Development](help/Addons)
* [Theme Development](help/themes)
* [Smarty 3 Templates](help/smarty3-templates)
* [Protokoll Dokumentation](help/Protocol) (EN)
diff --git a/doc/de/Improve-Performance.md b/doc/de/Improve-Performance.md
index e4bbbffb5b..c1f0a54fa0 100644
--- a/doc/de/Improve-Performance.md
+++ b/doc/de/Improve-Performance.md
@@ -28,10 +28,10 @@ Der Nachteil: Du siehst nicht jede Antwort einer OStatus-Unterhaltung. Aus diese
Wenn du MyISAM (Standardeinstellung) oder InnoDB mit MariaDB 10 nutzt, dann beschleunigt dies die Suche.
-Plugins
+Addons
--------
-Aktiviere die folgenden Plugins:
+Aktiviere die folgenden Addons:
rendertime
@@ -39,7 +39,7 @@ Aktiviere die folgenden Plugins:
**Beschreibung**
-Dieses Plugin beschleunigt dein System nicht, aber es hilft dabei, die Flaschenhälse zu ermitteln.
+Dieses Addon beschleunigt dein System nicht, aber es hilft dabei, die Flaschenhälse zu ermitteln.
Wenn es aktiviert ist, dann siehst du Werte wie die folgenden auf jeder deiner Seiten:
diff --git a/doc/de/Installing-Connectors.md b/doc/de/Installing-Connectors.md
index 76daa685fb..f9fe5b0f72 100644
--- a/doc/de/Installing-Connectors.md
+++ b/doc/de/Installing-Connectors.md
@@ -3,29 +3,29 @@ Konnektoren installieren (Twitter/GNU Social)
* [Zur Startseite der Hilfe](help)
-Friendica nutzt Plugins, um die Verbindung zu anderen Netzwerken wie Twitter oder App.net zu gewährleisten.
+Friendica nutzt Erweiterung, um die Verbindung zu anderen Netzwerken wie Twitter oder App.net zu gewährleisten.
-Es gibt außerdem ein Plugin, um über einen bestehenden GNU Social-Account diesen Service zu nutzen.
-Du brauchst dieses Plugin aber nicht, um mit GNU Social-Mitgliedern von Friendica aus zu kommunizieren - es sei denn, du wünschst es, über einen existierenden Account einen Beitrag zu schreiben.
+Es gibt außerdem ein Erweiterung, um über einen bestehenden GNU Social-Account diesen Service zu nutzen.
+Du brauchst dieses Erweiterung aber nicht, um mit GNU Social-Mitgliedern von Friendica aus zu kommunizieren - es sei denn, du wünschst es, über einen existierenden Account einen Beitrag zu schreiben.
-Alle drei Plugins benötigen einen Account im gewünschten Netzwerk.
+Alle drei Erweiterung benötigen einen Account im gewünschten Netzwerk.
Zusätzlich musst du (bzw. der Administrator der Seite) einen API-Schlüssel holen, um einen authentifizierten Zugriff zu deinem Friendica-Server herstellen zu lassen.
**Seitenkonfiguration**
-Plugins müssen vom Administrator installiert werden, bevor sie genutzt werden können.
+Erweiterung müssen vom Administrator installiert werden, bevor sie genutzt werden können.
Dieses kann über das Administrationsmenü erstellt werden.
Jeder der Konnektoren benötigt zudem einen API-Schlüssel vom Service, der verbunden werden soll.
-Einige Plugins erlaube es, diese Informationen auf den Administrationsseiten einzustellen, wohingegen andere eine direkte Bearbeitung der Konfigurationsdatei ".htconfig.php" erfordern.
+Einige Erweiterung erlaube es, diese Informationen auf den Administrationsseiten einzustellen, wohingegen andere eine direkte Bearbeitung der Konfigurationsdatei ".htconfig.php" erfordern.
Der Weg, um diese Schlüssel zu erhalten, variiert stark, jedoch brauchen fast alle einen bestehenden Account im gewünschten Service.
Einmal installiert, können diese Schlüssel von allen Seitennutzern genutzt werden.
-Im Folgenden findest du die Einstellungen für die verschiedenen Services (viele dieser Informationen kommen direkt aus den Quelldateien der Plugins):
+Im Folgenden findest du die Einstellungen für die verschiedenen Services (viele dieser Informationen kommen direkt aus den Quelldateien der Erweiterung):
-**Twitter Plugin für Friendica**
+**Twitter Erweiterung für Friendica**
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
@@ -33,7 +33,7 @@ Im Folgenden findest du die Einstellungen für die verschiedenen Services (viele
* License:3-clause BSD license
Konfiguration:
-Um dieses Plugin zu nutzen, benötigst du einen OAuth Consumer-Schlüsselpaar (Schlüssel und Geheimnis), das du auf der Seite [https://twitter.com/apps](https://twitter.com/apps) erhalten kannst
+Um dieses Erweiterung zu nutzen, benötigst du einen OAuth Consumer-Schlüsselpaar (Schlüssel und Geheimnis), das du auf der Seite [https://twitter.com/apps](https://twitter.com/apps) erhalten kannst
Registriere deine Friendica-Seite als "Client"-Anwendung mit "Read&Write"-Zugriff. Wir benötigen "Twitter als Login" nicht. Sobald du deine Anwendung installiert hast, erhältst du das Schlüsselpaar für deine Seite.
@@ -47,7 +47,7 @@ $a->config['twitter']['consumersecret'] = 'your consumer_secret here';
Anschließend kann der Nutzer deiner Seite die Twitter-Einstellungen selbst eintragen: "Einstellungen -> Connector Einstellungen".
-**GNU Social Plugin für Friendica**
+**GNU Social Erweiterung für Friendica**
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
diff --git a/doc/de/Plugins.md b/doc/de/Plugins.md
index 6ad3ac8f78..f4c14bc613 100644
--- a/doc/de/Plugins.md
+++ b/doc/de/Plugins.md
@@ -1,4 +1,4 @@
-Friendica Addon/Plugin-Entwicklung
+Friendica Addon/Entwicklung
==============
* [Zur Startseite der Hilfe](help)
@@ -8,30 +8,30 @@ Das Facebook-Addon bietet ein Beispiel dafür, die "addon"- und "module"-Funktio
Addons arbeiten, indem sie Event Hooks abfangen.
Module arbeiten, indem bestimmte Seitenanfragen (durch den URL-Pfad) abgefangen werden.
-Plugin-Namen können keine Leerstellen oder andere Interpunktionen enthalten und werden als Datei- und Funktionsnamen genutzt.
+Addon-Namen können keine Leerstellen oder andere Interpunktionen enthalten und werden als Datei- und Funktionsnamen genutzt.
Du kannst einen lesbaren Namen im Kommentarblock eintragen.
-Jedes Addon muss beides beinhalten - eine Installations- und eine Deinstallationsfunktion, die auf dem Addon-/Plugin-Namen basieren; z.B. "plugin1name_install()".
-Diese beiden Funktionen haben keine Argumente und sind dafür verantwortlich, Event Hooks zu registrieren und abzumelden (unregistering), die dein Plugin benötigt.
-Die Installations- und Deinstallationsfunktionfunktionen werden auch ausgeführt (z.B. neu installiert), wenn sich das Plugin nach der Installation ändert - somit sollte deine Deinstallationsfunktion keine Daten zerstört und deine Installationsfunktion sollte bestehende Daten berücksichtigen.
+Jedes Addon muss beides beinhalten - eine Installations- und eine Deinstallationsfunktion, die auf dem Addon-Namen basieren; z.B. "addon1name_install()".
+Diese beiden Funktionen haben keine Argumente und sind dafür verantwortlich, Event Hooks zu registrieren und abzumelden (unregistering), die dein Addon benötigt.
+Die Installations- und Deinstallationsfunktionfunktionen werden auch ausgeführt (z.B. neu installiert), wenn sich das Addon nach der Installation ändert - somit sollte deine Deinstallationsfunktion keine Daten zerstört und deine Installationsfunktion sollte bestehende Daten berücksichtigen.
Zukünftige Extensions werden möglicherweise "Setup" und "Entfernen" anbieten.
-Plugins sollten einen Kommentarblock mit den folgenden vier Parametern enthalten:
+Addons sollten einen Kommentarblock mit den folgenden vier Parametern enthalten:
/*
- * Name: My Great Plugin
- * Description: This is what my plugin does. It's really cool.
+ * Name: My Great Addon
+ * Description: This is what my addon does. It's really cool.
* Version: 1.0
* Author: John Q. Public
*/
-Registriere deine Plugin-Hooks während der Installation.
+Registriere deine Addon-Hooks während der Installation.
Addon::registerHook($hookname, $file, $function);
$hookname ist ein String und entspricht einem bekannten Friendica-Hook.
$file steht für den Pfadnamen, der relativ zum Top-Level-Friendicaverzeichnis liegt.
-Das *sollte* "addon/plugin_name/plugin_name.php' sein.
+Das *sollte* "addon/addon_name/addon_name.php' sein.
$function ist ein String und der Name der Funktion, die ausgeführt wird, wenn der Hook aufgerufen wird.
@@ -57,19 +57,19 @@ Achte darauf, diese mit "&" zu deklarieren, wenn du sie bearbeiten willst.
Module
---
-Plugins/Addons können auch als "Module" agieren und alle Seitenanfragen für eine bestimte URL abfangen.
-Um ein Plugin als Modul zu nutzen, ist es nötig, die Funktion "plugin_name_module()" zu definieren, die keine Argumente benötigt und nichts weiter machen muss.
+Addons können auch als "Module" agieren und alle Seitenanfragen für eine bestimte URL abfangen.
+Um ein Addon als Modul zu nutzen, ist es nötig, die Funktion "addon_name_module()" zu definieren, die keine Argumente benötigt und nichts weiter machen muss.
-Wenn diese Funktion existiert, wirst du nun alle Seitenanfragen für "http://example.com/plugin_name" erhalten - mit allen URL-Komponenten als zusätzliche Argumente.
+Wenn diese Funktion existiert, wirst du nun alle Seitenanfragen für "http://example.com/addon_name" erhalten - mit allen URL-Komponenten als zusätzliche Argumente.
Diese werden in ein Array $a->argv geparst und stimmen mit $a->argc überein, wobei sie die Anzahl der URL-Komponenten abbilden.
-So würde http://example.com/plugin/arg1/arg2 nach einem Modul "plugin" suchen und seiner Modulfunktion die $a-App-Strukur übergeben (dies ist für viele Komponenten verfügbar). Das umfasst:
+So würde http://example.com/addon/arg1/arg2 nach einem Modul "addon" suchen und seiner Modulfunktion die $a-App-Strukur übergeben (dies ist für viele Komponenten verfügbar). Das umfasst:
$a->argc = 3
- $a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
+ $a->argv = array(0 => 'addon', 1 => 'arg1', 2 => 'arg2');
-Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(App $a), welche den Seiteninhalt definiert und zurückgibt.
-Sie können auch plugin_name_post(App $a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
-Du kannst ebenso plugin_name_init(App $a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
+Deine Modulfunktionen umfassen oft die Funktion addon_name_content(App $a), welche den Seiteninhalt definiert und zurückgibt.
+Sie können auch addon_name_post(App $a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
+Du kannst ebenso addon_name_init(App $a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
Derzeitige Hooks
@@ -109,10 +109,10 @@ Derzeitige Hooks
**'settings_post'** - wird aufgerufen, wenn die Einstellungsseiten geladen werden.
$b ist der $_POST-Array
-**'plugin_settings'** - wird aufgerufen, wenn die HTML-Ausgabe der Addon-Einstellungsseite generiert wird.
+**'addon_settings'** - wird aufgerufen, wenn die HTML-Ausgabe der Addon-Einstellungsseite generiert wird.
$b ist die HTML-Ausgabe (String) der Addon-Einstellungsseite vor dem finalen ""-Tag.
-**'plugin_settings_post'** - wird aufgerufen, wenn die Addon-Einstellungsseite geladen wird.
+**'addon_settings_post'** - wird aufgerufen, wenn die Addon-Einstellungsseite geladen wird.
$b ist der $_POST-Array
**'profile_post'** - wird aufgerufen, wenn die Profilseite angezeigt wird.
@@ -287,10 +287,6 @@ include/conversation.php: Addon::callHooks('jot_tool', $jotplugins);
include/conversation.php: Addon::callHooks('jot_networks', $jotnets);
-include/plugin.php: if(! function_exists('call_hooks')) {
-
-include/plugin.php:function Addon::callHooks($name, &$data = null) {
-
index.php: Addon::callHooks('init_1');
index.php: Addon::callHooks('app_menu', $arr);
@@ -327,13 +323,13 @@ mod/contacts.php: Addon::callHooks('contact_edit_post', $_POST);
mod/contacts.php: Addon::callHooks('contact_edit', $arr);
-mod/settings.php: Addon::callHooks('plugin_settings_post', $_POST);
+mod/settings.php: Addon::callHooks('addon_settings_post', $_POST);
mod/settings.php: Addon::callHooks('connector_settings_post', $_POST);
mod/settings.php: Addon::callHooks('settings_post', $_POST);
-mod/settings.php: Addon::callHooks('plugin_settings', $settings_addons);
+mod/settings.php: Addon::callHooks('addon_settings', $settings_addons);
mod/settings.php: Addon::callHooks('connector_settings', $settings_connectors);
diff --git a/doc/de/Settings.md b/doc/de/Settings.md
index 91cad094cc..1c7a487431 100644
--- a/doc/de/Settings.md
+++ b/doc/de/Settings.md
@@ -195,7 +195,7 @@ An dieser Stelle kannst du existierende Accounts vom Zugriff auf die Instanz blo
Im letzten Bereich auf der Seite kannst du als Administrator neue Accounts anlegen.
Das Passwort für so eingerichtete Accounts werden per E-Mail an die Nutzer geschickt.
-## Plugins
+## Addons
Dieser Bereich des Admin Panels dient der Auswahl und Konfiguration der Erweiterungen von Friendica.
Sie müssen in das `/addon` Verzeichnis kopiert werden.
@@ -203,11 +203,11 @@ Auf der Seite wird eine Liste der verfügbaren Erweiterungen angezeigt.
Neben den Namen der Erweiterungen wird ein Indikator angezeigt, der anzeigt ob das Addon gerade aktiviert ist oder nicht.
Wenn du die Erweiterungen aktualisiert die du auf deiner Friendica-Instanz nutzt könnte es sein, dass sie neu geladen werden müssen, damit die Änderungen aktiviert werden.
-Um diesen Prozess zu vereinfachen gibt es am Anfang der Seite einen Button um alle aktiven Plugins neu zu laden.
+Um diesen Prozess zu vereinfachen gibt es am Anfang der Seite einen Button um alle aktiven Addons neu zu laden.
## Themen
-Der Bereich zur Kontrolle der auf der Friendica-Instanz verfügbaren Themen funktioniert analog zum Plugins Bereich.
+Der Bereich zur Kontrolle der auf der Friendica-Instanz verfügbaren Themen funktioniert analog zum Addons Bereich.
Jedes Theme hat eine extra Seite auf der der aktuelle Status, ein Bildschirmfoto des Themes, zusätzliche Informationen und eventuelle Einstellungen des Themes zu finden sind.
Genau wie Erweiterungen können Themes in der Übersichtsliste oder der Theme-Seite aktiviert bzw. deaktiviert werden.
Um ein Standardtheme für die Instanz zu wählen, benutze bitte die *Seiten* Bereich des Admin Panels.
@@ -256,7 +256,7 @@ Dazu muss man nur die GUID des Beitrags kennen.
Diese kann u.a. in der Adresse der `/display`-Seite gefunden werden, wenn man dem *Link zum Originalbeitrag* folgt.
Hier ist die GUID der letzte Teil der URL in der Adresszeile des Browsers.
-## Plugin Features
+## Addon Features
Einige der Erweiterungen von Friendica benötigen global gültige Einstellungen, die der Administrator vornehmen muss.
Diese Erweiterungen sind hier aufgelistet, damit du die Einstellungen schneller findest.
From a7d887a68e4eda7ebc0318f29d7924944e5a6c1e Mon Sep 17 00:00:00 2001
From: Adam Magness
Date: Wed, 17 Jan 2018 19:18:00 -0500
Subject: [PATCH 08/12] CSS files
update plugin references in css files.
---
view/theme/duepuntozero/style.css | 12 ++++++------
view/theme/frost-mobile/style.css | 12 ++++++------
view/theme/frost/style.css | 12 ++++++------
view/theme/quattro/dark/style.css | 18 +++++++++---------
view/theme/quattro/green/style.css | 18 +++++++++---------
view/theme/quattro/lilac/style.css | 18 +++++++++---------
view/theme/smoothly/style.css | 6 +++---
view/theme/vier/plusminus.css | 2 +-
view/theme/vier/style.css | 6 +++---
9 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css
index 8e2c5d4478..75ada9b0b2 100644
--- a/view/theme/duepuntozero/style.css
+++ b/view/theme/duepuntozero/style.css
@@ -1123,7 +1123,7 @@ input#dfrn-url {
/* add ellipsis on text overflow */
/* this work on safari, opera, ie, chrome. */
/* firefox users have to wait support or we */
- /* can use a jquery plugin http://bit.ly/zJskg */
+ /* can use a jquery addon http://bit.ly/zJskg */
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
width: 100%;
@@ -2550,7 +2550,7 @@ aside input[type='text'] {
}
-#plugin-settings-link, #account-settings-link {
+#addon-settings-link, #account-settings-link {
margin-bottom: 10px;
}
@@ -3082,10 +3082,10 @@ aside input[type='text'] {
text-align: right;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0px; padding: 0px;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
border: 1px solid #888888;
@@ -3093,8 +3093,8 @@ aside input[type='text'] {
margin-bottom: 5px;
clear: left;
}
-#adminpage .plugin .desc { margin-left: 2.5em;}
-#adminpage .toggleplugin {
+#adminpage .addon .desc { margin-left: 2.5em;}
+#adminpage .toggleaddon {
float:left;
margin-right: 1em;
}
diff --git a/view/theme/frost-mobile/style.css b/view/theme/frost-mobile/style.css
index 7c5d2c7609..632e44b1da 100644
--- a/view/theme/frost-mobile/style.css
+++ b/view/theme/frost-mobile/style.css
@@ -1385,7 +1385,7 @@ input#dfrn-url {
/* add ellipsis on text overflow */
/* this work on safari, opera, ie, chrome. */
/* firefox users have to wait support or we */
- /* can use a jquery plugin http://bit.ly/zJskg */
+ /* can use a jquery addon http://bit.ly/zJskg */
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
width: 100%;
@@ -3162,7 +3162,7 @@ aside input[type='text'] {
}
-#plugin-settings-link, #account-settings-link {
+#addon-settings-link, #account-settings-link {
margin-bottom: 10px;
}
@@ -3776,10 +3776,10 @@ aside input[type='text'] {
text-align: right;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0px; padding: 0px;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
border: 1px solid #888888;
@@ -3787,8 +3787,8 @@ aside input[type='text'] {
margin-bottom: 5px;
clear: left;
}
-#adminpage .plugin .desc { margin-left: 2.5em;}
-#adminpage .toggleplugin {
+#adminpage .addon .desc { margin-left: 2.5em;}
+#adminpage .toggleaddon {
float:left;
margin-right: 1em;
}
diff --git a/view/theme/frost/style.css b/view/theme/frost/style.css
index 9b65da9c8c..3ed83e28b9 100644
--- a/view/theme/frost/style.css
+++ b/view/theme/frost/style.css
@@ -1365,7 +1365,7 @@ input#dfrn-url {
/* add ellipsis on text overflow */
/* this work on safari, opera, ie, chrome. */
/* firefox users have to wait support or we */
- /* can use a jquery plugin http://bit.ly/zJskg */
+ /* can use a jquery addon http://bit.ly/zJskg */
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
width: 100%;
@@ -2964,7 +2964,7 @@ aside input[type='text'] {
}
-#plugin-settings-link, #account-settings-link {
+#addon-settings-link, #account-settings-link {
margin-bottom: 10px;
}
@@ -3584,10 +3584,10 @@ aside input[type='text'] {
text-align: right;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0px; padding: 0px;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
border: 1px solid #888888;
@@ -3595,8 +3595,8 @@ aside input[type='text'] {
margin-bottom: 5px;
clear: left;
}
-#adminpage .plugin .desc { margin-left: 2.5em;}
-#adminpage .toggleplugin {
+#adminpage .addon .desc { margin-left: 2.5em;}
+#adminpage .toggleaddon {
float:left;
margin-right: 1em;
}
diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css
index 3e8fe754b8..36a0a6aee7 100644
--- a/view/theme/quattro/dark/style.css
+++ b/view/theme/quattro/dark/style.css
@@ -64,7 +64,7 @@
.icon.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
-.icon.plugin {
+.icon.addon {
background-image: url("../../../images/icons/22/plugin.png");
}
.icon.type-unkn {
@@ -143,7 +143,7 @@
.icon.s10.unlock {
background-image: url("../../../images/icons/10/unlock.png");
}
-.icon.s10.plugin {
+.icon.s10.addon {
background-image: url("../../../images/icons/10/plugin.png");
}
.icon.s10.type-unkn {
@@ -222,7 +222,7 @@
.icon.s16.unlock {
background-image: url("../../../images/icons/16/unlock.png");
}
-.icon.s16.plugin {
+.icon.s16.addon {
background-image: url("../../../images/icons/16/plugin.png");
}
.icon.s16.type-unkn {
@@ -301,7 +301,7 @@
.icon.s22.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
-.icon.s22.plugin {
+.icon.s22.addon {
background-image: url("../../../images/icons/22/plugin.png");
}
.icon.s22.type-unkn {
@@ -380,7 +380,7 @@
.icon.s48.unlock {
background-image: url("../../../images/icons/48/unlock.png");
}
-.icon.s48.plugin {
+.icon.s48.addon {
background-image: url("../../../images/icons/48/plugin.png");
}
.icon.s48.type-unkn {
@@ -2515,11 +2515,11 @@ footer {
clear: left;
text-align: right;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0;
padding: 0;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
border: 1px solid #888888;
@@ -2527,10 +2527,10 @@ footer {
margin-bottom: 5px;
clear: left;
}
-#adminpage .plugin desc {
+#adminpage .addon desc {
margin-left: 2.5em;
}
-#adminpage .toggleplugin {
+#adminpage .toggleaddon {
float: left;
margin-right: 1em;
}
diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css
index af5cfcedf0..9776faeb00 100644
--- a/view/theme/quattro/green/style.css
+++ b/view/theme/quattro/green/style.css
@@ -64,7 +64,7 @@
.icon.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
-.icon.plugin {
+.icon.addon {
background-image: url("../../../images/icons/22/plugin.png");
}
.icon.type-unkn {
@@ -143,7 +143,7 @@
.icon.s10.unlock {
background-image: url("../../../images/icons/10/unlock.png");
}
-.icon.s10.plugin {
+.icon.s10.addon {
background-image: url("../../../images/icons/10/plugin.png");
}
.icon.s10.type-unkn {
@@ -222,7 +222,7 @@
.icon.s16.unlock {
background-image: url("../../../images/icons/16/unlock.png");
}
-.icon.s16.plugin {
+.icon.s16.addon {
background-image: url("../../../images/icons/16/plugin.png");
}
.icon.s16.type-unkn {
@@ -301,7 +301,7 @@
.icon.s22.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
-.icon.s22.plugin {
+.icon.s22.addon {
background-image: url("../../../images/icons/22/plugin.png");
}
.icon.s22.type-unkn {
@@ -380,7 +380,7 @@
.icon.s48.unlock {
background-image: url("../../../images/icons/48/unlock.png");
}
-.icon.s48.plugin {
+.icon.s48.addon {
background-image: url("../../../images/icons/48/plugin.png");
}
.icon.s48.type-unkn {
@@ -2518,11 +2518,11 @@ footer {
clear: left;
text-align: right;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0;
padding: 0;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
border: 1px solid #888888;
@@ -2530,10 +2530,10 @@ footer {
margin-bottom: 5px;
clear: left;
}
-#adminpage .plugin desc {
+#adminpage .addon desc {
margin-left: 2.5em;
}
-#adminpage .toggleplugin {
+#adminpage .toggleaddon {
float: left;
margin-right: 1em;
}
diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css
index 0c17b00331..4760d4b434 100644
--- a/view/theme/quattro/lilac/style.css
+++ b/view/theme/quattro/lilac/style.css
@@ -64,7 +64,7 @@
.icon.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
-.icon.plugin {
+.icon.addon {
background-image: url("../../../images/icons/22/plugin.png");
}
.icon.type-unkn {
@@ -143,7 +143,7 @@
.icon.s10.unlock {
background-image: url("../../../images/icons/10/unlock.png");
}
-.icon.s10.plugin {
+.icon.s10.addon {
background-image: url("../../../images/icons/10/plugin.png");
}
.icon.s10.type-unkn {
@@ -222,7 +222,7 @@
.icon.s16.unlock {
background-image: url("../../../images/icons/16/unlock.png");
}
-.icon.s16.plugin {
+.icon.s16.addon {
background-image: url("../../../images/icons/16/plugin.png");
}
.icon.s16.type-unkn {
@@ -301,7 +301,7 @@
.icon.s22.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
-.icon.s22.plugin {
+.icon.s22.addon {
background-image: url("../../../images/icons/22/plugin.png");
}
.icon.s22.type-unkn {
@@ -380,7 +380,7 @@
.icon.s48.unlock {
background-image: url("../../../images/icons/48/unlock.png");
}
-.icon.s48.plugin {
+.icon.s48.addon {
background-image: url("../../../images/icons/48/plugin.png");
}
.icon.s48.type-unkn {
@@ -2518,11 +2518,11 @@ footer {
clear: left;
text-align: right;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0;
padding: 0;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
border: 1px solid #888888;
@@ -2530,10 +2530,10 @@ footer {
margin-bottom: 5px;
clear: left;
}
-#adminpage .plugin desc {
+#adminpage .addon desc {
margin-left: 2.5em;
}
-#adminpage .toggleplugin {
+#adminpage .toggleaddon {
float: left;
margin-right: 1em;
}
diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css
index 07fc3ed895..8d84e1b03a 100644
--- a/view/theme/smoothly/style.css
+++ b/view/theme/smoothly/style.css
@@ -3824,12 +3824,12 @@ margin-left: 0px;
}
#adminpage
-#pluginslist {
+#addonslist {
margin: 0px;
padding: 0px;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
clear: left;
@@ -3844,7 +3844,7 @@ margin-left: 0px;
margin:10px 10px 10px 0;
}
-#adminpage .toggleplugin {
+#adminpage .toggleaddon {
float: left;
margin-right: 1em;
}
diff --git a/view/theme/vier/plusminus.css b/view/theme/vier/plusminus.css
index facfb975e2..d8e58e1781 100644
--- a/view/theme/vier/plusminus.css
+++ b/view/theme/vier/plusminus.css
@@ -647,7 +647,7 @@ td.checkbox, td.tools{
}
-/* Settings - Plugin */
+/* Settings - Addon */
.settings-block.fakelink h3{
font-size:16px;
diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css
index e45a3751e7..48a89c0b40 100644
--- a/view/theme/vier/style.css
+++ b/view/theme/vier/style.css
@@ -71,11 +71,11 @@ img {
clear:left;
}
-#adminpage #pluginslist {
+#adminpage #addonslist {
margin: 0px; padding: 0px;
}
-#adminpage .plugin {
+#adminpage .addon {
list-style: none;
display: block;
/* border: 1px solid #888888; */
@@ -84,7 +84,7 @@ img {
clear: left;
}
-#adminpage .toggleplugin {
+#adminpage .toggleaddon {
float:left;
margin-right: 1em;
}
From ac374f7773e6ad43f01f5b50b96310b3de122fc4 Mon Sep 17 00:00:00 2001
From: Adam Magness
Date: Wed, 17 Jan 2018 19:38:14 -0500
Subject: [PATCH 09/12] Review updates
---
INSTALL.txt | 2 +-
doc/{Plugins.md => Addons.md} | 4 ++--
doc/database/db_addon.md | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
rename doc/{Plugins.md => Addons.md} (99%)
diff --git a/INSTALL.txt b/INSTALL.txt
index 5dee845677..01fe65d118 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -141,7 +141,7 @@ installation, it will look like
$a->config['system']['addon'] = 'js_upload';
This indicates the "js_upload" addon module is enabled. You may add additional
-addons/addons using this same line in the configuration file. Change it to
+addons using this same line in the configuration file. Change it to
read
$a->config['system']['addon'] = 'js_upload,poormancron';
diff --git a/doc/Plugins.md b/doc/Addons.md
similarity index 99%
rename from doc/Plugins.md
rename to doc/Addons.md
index 4c2596ee6c..5d13107769 100644
--- a/doc/Plugins.md
+++ b/doc/Addons.md
@@ -9,7 +9,7 @@ Modules work by intercepting specific page requests (by URL path).
Addon names cannot contain spaces or other punctuation and are used as filenames and function names.
You may supply a "friendly" name within the comment block.
-Each addon must contain both an install and an uninstall function based on the addon/addon name.
+Each addon must contain both an install and an uninstall function based on the addon name.
For instance "addon1name_install()".
These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your addon will require.
The install and uninstall functions will also be called (i.e. re-installed) if the addon changes after installation.
@@ -69,7 +69,7 @@ Remember to declare it with '&' if you wish to alter it.
Modules
---
-Addons/addons may also act as "modules" and intercept all page requests for a given URL path.
+Addons may also act as "modules" and intercept all page requests for a given URL path.
In order for a addon to act as a module it needs to define a function "addon_name_module()" which takes no arguments and needs not do anything.
If this function exists, you will now receive all page requests for "http://my.web.site/addon_name" - with any number of URL components as additional arguments.
diff --git a/doc/database/db_addon.md b/doc/database/db_addon.md
index eceb3b68b9..cd8a3d44a6 100644
--- a/doc/database/db_addon.md
+++ b/doc/database/db_addon.md
@@ -12,6 +12,6 @@ Table addon
| plugin_admin | 1 = has admin config, 0 = has no admin config | tinyint(1) | NO | | 0 | |
Notes:
-These are addons which have been enabled by the site administrator on the admin/addon page
+These are addons which have been enabled by the site administrator on the addon page
Return to [database documentation](help/database)
From 5d037352383c6e9d262728d2f08ddc364c37b1b1 Mon Sep 17 00:00:00 2001
From: Adam Magness
Date: Sat, 20 Jan 2018 08:22:18 -0500
Subject: [PATCH 10/12] Update hook names
update hook names and other plugin references.
---
mod/admin.php | 6 +-
mod/settings.php | 38 +--
src/Core/Addon.php | 521 ++++++++++++++++++-----------------
src/Database/DBStructure.php | 4 +-
4 files changed, 286 insertions(+), 283 deletions(-)
diff --git a/mod/admin.php b/mod/admin.php
index 33ea343c81..0b53dc93d8 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -62,8 +62,8 @@ function admin_post(App $a)
if ($a->argc > 2 &&
is_file("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php")) {
@include_once("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php");
- if (function_exists($a->argv[2] . '_plugin_admin_post')) {
- $func = $a->argv[2] . '_plugin_admin_post';
+ if (function_exists($a->argv[2] . '_addon_admin_post')) {
+ $func = $a->argv[2] . '_addon_admin_post';
$func($a);
}
}
@@ -1790,7 +1790,7 @@ function admin_page_addons(App $a)
$admin_form = "";
if (in_array($addon, $a->addons_admin)) {
@require_once("addon/$addon/$addon.php");
- $func = $addon . '_plugin_admin';
+ $func = $addon . '_addon_admin';
$func($a, $admin_form);
}
diff --git a/mod/settings.php b/mod/settings.php
index c067f3db19..a5a4d4ad50 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -170,23 +170,25 @@ function settings_post(App $a)
icon='%s',
uid=%d
WHERE client_id='%s'",
- dbesc($key),
- dbesc($secret),
- dbesc($name),
- dbesc($redirect),
- dbesc($icon),
- local_user(),
- dbesc($key));
+ dbesc($key),
+ dbesc($secret),
+ dbesc($name),
+ dbesc($redirect),
+ dbesc($icon),
+ local_user(),
+ dbesc($key)
+ );
} else {
q("INSERT INTO clients
(client_id, pw, name, redirect_uri, icon, uid)
VALUES ('%s', '%s', '%s', '%s', '%s',%d)",
- dbesc($key),
- dbesc($secret),
- dbesc($name),
- dbesc($redirect),
- dbesc($icon),
- local_user());
+ dbesc($key),
+ dbesc($secret),
+ dbesc($name),
+ dbesc($redirect),
+ dbesc($icon),
+ local_user()
+ );
}
}
goaway(System::baseUrl(true)."/settings/oauth/");
@@ -196,12 +198,12 @@ function settings_post(App $a)
if (($a->argc > 1) && ($a->argv[1] == 'addon')) {
check_form_security_token_redirectOnErr('/settings/addon', 'settings_addon');
- Addon::callHooks('plugin_settings_post', $_POST);
+ Addon::callHooks('addon_settings_post', $_POST);
return;
}
- if (($a->argc > 1) && ($a->argv[1] == 'connectors')) {
-
+ if (($a->argc > 1) && ($a->argv[1] == 'connectors'))
+ {
check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors');
if (x($_POST, 'general-submit')) {
@@ -749,12 +751,12 @@ function settings_content(App $a)
if (($a->argc > 1) && ($a->argv[1] === 'addon')) {
$settings_addons = "";
- $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
+ $r = q("SELECT * FROM `hook` WHERE `hook` = 'addon_settings' ");
if (!DBM::is_result($r)) {
$settings_addons = t('No Addon settings configured');
}
- Addon::callHooks('plugin_settings', $settings_addons);
+ Addon::callHooks('addon_settings', $settings_addons);
$tpl = get_markup_template('settings/addons.tpl');
diff --git a/src/Core/Addon.php b/src/Core/Addon.php
index 7d5115b27d..af3d843a9a 100644
--- a/src/Core/Addon.php
+++ b/src/Core/Addon.php
@@ -17,298 +17,299 @@ require_once 'include/dba.php';
*/
class Addon
{
- /**
- * @brief uninstalls an addon.
- *
- * @param string $addon name of the addon
- * @return boolean
- */
- public static function uninstall($addon)
- {
- logger("Addons: uninstalling " . $addon);
- dba::delete('addon', ['name' => $addon]);
+ /**
+ * @brief uninstalls an addon.
+ *
+ * @param string $addon name of the addon
+ * @return boolean
+ */
+ public static function uninstall($addon)
+ {
+ logger("Addons: uninstalling " . $addon);
+ dba::delete('addon', ['name' => $addon]);
- @include_once('addon/' . $addon . '/' . $addon . '.php');
- if (function_exists($addon . '_uninstall')) {
- $func = $addon . '_uninstall';
- $func();
- }
- }
+ @include_once('addon/' . $addon . '/' . $addon . '.php');
+ if (function_exists($addon . '_uninstall')) {
+ $func = $addon . '_uninstall';
+ $func();
+ }
+ }
- /**
- * @brief installs an addon.
- *
- * @param string $addon name of the addon
- * @return bool
- */
- public static function install($addon)
- {
- // silently fail if addon was removed
+ /**
+ * @brief installs an addon.
+ *
+ * @param string $addon name of the addon
+ * @return bool
+ */
+ public static function install($addon)
+ {
+ // silently fail if addon was removed
- if (!file_exists('addon/' . $addon . '/' . $addon . '.php')) {
- return false;
- }
- logger("Addons: installing " . $addon);
- $t = @filemtime('addon/' . $addon . '/' . $addon . '.php');
- @include_once('addon/' . $addon . '/' . $addon . '.php');
- if (function_exists($addon . '_install')) {
- $func = $addon . '_install';
- $func();
+ if (!file_exists('addon/' . $addon . '/' . $addon . '.php')) {
+ return false;
+ }
+ logger("Addons: installing " . $addon);
+ $t = @filemtime('addon/' . $addon . '/' . $addon . '.php');
+ @include_once('addon/' . $addon . '/' . $addon . '.php');
+ if (function_exists($addon . '_install')) {
+ $func = $addon . '_install';
+ $func();
- $addon_admin = (function_exists($addon."_plugin_admin") ? 1 : 0);
+ $addon_admin = (function_exists($addon."_addon_admin") ? 1 : 0);
- dba::insert('addon', ['name' => $addon, 'installed' => true,
- 'timestamp' => $t, 'plugin_admin' => $addon_admin]);
+ dba::insert('addon', ['name' => $addon, 'installed' => true,
+ 'timestamp' => $t, 'plugin_admin' => $addon_admin]);
- // we can add the following with the previous SQL
- // once most site tables have been updated.
- // This way the system won't fall over dead during the update.
+ // we can add the following with the previous SQL
+ // once most site tables have been updated.
+ // This way the system won't fall over dead during the update.
- if (file_exists('addon/' . $addon . '/.hidden')) {
- dba::update('addon', ['hidden' => true], ['name' => $addon]);
- }
- return true;
- } else {
- logger("Addons: FAILED installing " . $addon);
- return false;
- }
- }
+ if (file_exists('addon/' . $addon . '/.hidden')) {
+ dba::update('addon', ['hidden' => true], ['name' => $addon]);
+ }
+ return true;
+ } else {
+ logger("Addons: FAILED installing " . $addon);
+ return false;
+ }
+ }
- /**
- * reload all updated addons
- */
- public static function reload()
- {
- $addons = Config::get('system', 'addon');
- if (strlen($addons)) {
+ /**
+ * reload all updated addons
+ */
+ public static function reload()
+ {
+ $addons = Config::get('system', 'addon');
+ if (strlen($addons)) {
+ $r = dba::select('addon', [], ['installed' => 1]);
+ if (DBM::is_result($r)) {
+ $installed = $r;
+ } else {
+ $installed = [];
+ }
- $r = dba::select('addon', [], ['installed' => 1]);
- if (DBM::is_result($r)) {
- $installed = $r;
- } else {
- $installed = [];
- }
+ $addon_list = explode(',', $addons);
- $addon_list = explode(',', $addons);
+ if (count($addon_list)) {
+ foreach ($addon_list as $addon) {
+ $addon = trim($addon);
+ $fname = 'addon/' . $addon . '/' . $addon . '.php';
- if (count($addon_list)) {
- foreach ($addon_list as $addon) {
+ if (file_exists($fname)) {
+ $t = @filemtime($fname);
+ foreach ($installed as $i) {
+ if (($i['name'] == $addon) && ($i['timestamp'] != $t)) {
+ logger('Reloading addon: ' . $i['name']);
+ @include_once($fname);
- $addon = trim($addon);
+ if (function_exists($addon . '_uninstall')) {
+ $func = $addon . '_uninstall';
+ $func();
+ }
+ if (function_exists($addon . '_install')) {
+ $func = $addon . '_install';
+ $func();
+ }
+ dba::update('addon', ['timestamp' => $t], ['id' => $i['id']]);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
- $fname = 'addon/' . $addon . '/' . $addon . '.php';
-
- if (file_exists($fname)) {
- $t = @filemtime($fname);
- foreach ($installed as $i) {
- if (($i['name'] == $addon) && ($i['timestamp'] != $t)) {
- logger('Reloading addon: ' . $i['name']);
- @include_once($fname);
-
- if (function_exists($addon . '_uninstall')) {
- $func = $addon . '_uninstall';
- $func();
- }
- if (function_exists($addon . '_install')) {
- $func = $addon . '_install';
- $func();
- }
- dba::update('addon', ['timestamp' => $t], ['id' => $i['id']]);
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * @brief check if addon is enabled
- *
- * @param string $addon
- * @return boolean
- */
- public static function isEnabled($addon)
- {
- return dba::exists('addon', ['installed' => true, 'name' => $addon]);
- }
+ /**
+ * @brief check if addon is enabled
+ *
+ * @param string $addon
+ * @return boolean
+ */
+ public static function isEnabled($addon)
+ {
+ return dba::exists('addon', ['installed' => true, 'name' => $addon]);
+ }
- /**
- * @brief registers a hook.
- *
- * @param string $hook the name of the hook
- * @param string $file the name of the file that hooks into
- * @param string $function the name of the function that the hook will call
- * @param int $priority A priority (defaults to 0)
- * @return mixed|bool
- */
- public static function registerHook($hook, $file, $function, $priority = 0)
- {
- $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
- $exists = dba::exists('hook', $condition);
- if ($exists) {
- return true;
- }
+ /**
+ * @brief registers a hook.
+ *
+ * @param string $hook the name of the hook
+ * @param string $file the name of the file that hooks into
+ * @param string $function the name of the function that the hook will call
+ * @param int $priority A priority (defaults to 0)
+ * @return mixed|bool
+ */
+ public static function registerHook($hook, $file, $function, $priority = 0)
+ {
+ $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
+ $exists = dba::exists('hook', $condition);
+ if ($exists) {
+ return true;
+ }
- $r = dba::insert('hook', ['hook' => $hook, 'file' => $file, 'function' => $function, 'priority' => $priority]);
+ $r = dba::insert('hook', ['hook' => $hook, 'file' => $file, 'function' => $function, 'priority' => $priority]);
- return $r;
- }
+ return $r;
+ }
- /**
- * @brief unregisters a hook.
- *
- * @param string $hook the name of the hook
- * @param string $file the name of the file that hooks into
- * @param string $function the name of the function that the hook called
- * @return array
- */
- public static function unregisterHook($hook, $file, $function)
- {
- $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
- $r = dba::delete('hook', $condition);
- return $r;
- }
+ /**
+ * @brief unregisters a hook.
+ *
+ * @param string $hook the name of the hook
+ * @param string $file the name of the file that hooks into
+ * @param string $function the name of the function that the hook called
+ * @return array
+ */
+ public static function unregisterHook($hook, $file, $function)
+ {
+ $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
+ $r = dba::delete('hook', $condition);
+ return $r;
+ }
+ /**
+ * Load hooks
+ */
+ public static function loadHooks()
+ {
+ $a = get_app();
+ $a->hooks = [];
+ $r = dba::select('hook', ['hook', 'file', 'function'], [], ['order' => ['priority' => 'desc', 'file']]);
- public static function loadHooks() {
- $a = get_app();
- $a->hooks = [];
- $r = dba::select('hook', ['hook', 'file', 'function'], [], ['order' => ['priority' => 'desc', 'file']]);
+ while ($rr = dba::fetch($r)) {
+ if (! array_key_exists($rr['hook'], $a->hooks)) {
+ $a->hooks[$rr['hook']] = [];
+ }
+ $a->hooks[$rr['hook']][] = [$rr['file'],$rr['function']];
+ }
+ dba::close($r);
+ }
- while ($rr = dba::fetch($r)) {
- if (! array_key_exists($rr['hook'],$a->hooks)) {
- $a->hooks[$rr['hook']] = [];
- }
- $a->hooks[$rr['hook']][] = [$rr['file'],$rr['function']];
- }
- dba::close($r);
- }
+ /**
+ * @brief Calls a hook.
+ *
+ * Use this function when you want to be able to allow a hook to manipulate
+ * the provided data.
+ *
+ * @param string $name of the hook to call
+ * @param string|array &$data to transmit to the callback handler
+ */
+ public static function callHooks($name, &$data = null)
+ {
+ $a = get_app();
- /**
- * @brief Calls a hook.
- *
- * Use this function when you want to be able to allow a hook to manipulate
- * the provided data.
- *
- * @param string $name of the hook to call
- * @param string|array &$data to transmit to the callback handler
- */
- public static function callHooks($name, &$data = null)
- {
- $a = get_app();
+ if (is_array($a->hooks) && array_key_exists($name, $a->hooks)) {
+ foreach ($a->hooks[$name] as $hook) {
+ self::callSingleHook($a, $name, $hook, $data);
+ }
+ }
+ }
- if (is_array($a->hooks) && array_key_exists($name, $a->hooks)) {
- foreach ($a->hooks[$name] as $hook) {
- self::callSingleHook($a, $name, $hook, $data);
- }
- }
- }
+ /**
+ * @brief Calls a single hook.
+ *
+ * @param string $name of the hook to call
+ * @param array $hook Hook data
+ * @param string|array &$data to transmit to the callback handler
+ */
+ public static function callSingleHook($a, $name, $hook, &$data = null)
+ {
+ // Don't run a theme's hook if the user isn't using the theme
+ if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/'.current_theme()) === false) {
+ return;
+ }
- /**
- * @brief Calls a single hook.
- *
- * @param string $name of the hook to call
- * @param array $hook Hook data
- * @param string|array &$data to transmit to the callback handler
- */
- public static function callSingleHook($a, $name, $hook, &$data = null)
- {
- // Don't run a theme's hook if the user isn't using the theme
- if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/'.current_theme()) === false)
- return;
+ @include_once($hook[0]);
+ if (function_exists($hook[1])) {
+ $func = $hook[1];
+ $func($a, $data);
+ } else {
+ // remove orphan hooks
+ $condition = ['hook' => $name, 'file' => $hook[0], 'function' => $hook[1]];
+ dba::delete('hook', $condition);
+ }
+ }
- @include_once($hook[0]);
- if (function_exists($hook[1])) {
- $func = $hook[1];
- $func($a, $data);
- } else {
- // remove orphan hooks
- $condition = ['hook' => $name, 'file' => $hook[0], 'function' => $hook[1]];
- dba::delete('hook', $condition);
- }
- }
+ /**
+ * check if an app_menu hook exist for addon $name.
+ * Return true if the addon is an app
+ */
+ public static function isApp($name)
+ {
+ $a = get_app();
- /**
- * check if an app_menu hook exist for addon $name.
- * Return true if the addon is an app
- */
- function isApp($name)
- {
- $a = get_app();
+ if (is_array($a->hooks) && (array_key_exists('app_menu', $a->hooks))) {
+ foreach ($a->hooks['app_menu'] as $hook) {
+ if ($hook[0] == 'addon/'.$name.'/'.$name.'.php') {
+ return true;
+ }
+ }
+ }
- if (is_array($a->hooks) && (array_key_exists('app_menu',$a->hooks))) {
- foreach ($a->hooks['app_menu'] as $hook) {
- if ($hook[0] == 'addon/'.$name.'/'.$name.'.php')
- return true;
- }
- }
+ return false;
+ }
- return false;
- }
+ /**
+ * @brief Parse addon comment in search of addon infos.
+ *
+ * like
+ * \code
+ *...* Name: addon
+ * * Description: An addon which plugs in
+ * . * Version: 1.2.3
+ * * Author: John
+ * * Author: Jane
+ * *
+ * *\endcode
+ * @param string $addon the name of the addon
+ * @return array with the addon information
+ */
- /**
- * @brief Parse addon comment in search of addon infos.
- *
- * like
- * \code
- *...* Name: addon
- * * Description: An addon which plugs in
- * . * Version: 1.2.3
- * * Author: John
- * * Author: Jane
- * *
- * *\endcode
- * @param string $addon the name of the addon
- * @return array with the addon information
- */
+ public static function getInfo($addon)
+ {
+ $a = get_app();
- public static function getInfo($addon) {
+ $info=[
+ 'name' => $addon,
+ 'description' => "",
+ 'author' => [],
+ 'version' => "",
+ 'status' => ""
+ ];
- $a = get_app();
+ if (!is_file("addon/$addon/$addon.php")) {
+ return $info;
+ }
- $info=[
- 'name' => $addon,
- 'description' => "",
- 'author' => [],
- 'version' => "",
- 'status' => ""
- ];
+ $stamp1 = microtime(true);
+ $f = file_get_contents("addon/$addon/$addon.php");
+ $a->save_timestamp($stamp1, "file");
- if (!is_file("addon/$addon/$addon.php")) {
- return $info;
- }
+ $r = preg_match("|/\*.*\*/|msU", $f, $m);
- $stamp1 = microtime(true);
- $f = file_get_contents("addon/$addon/$addon.php");
- $a->save_timestamp($stamp1, "file");
-
- $r = preg_match("|/\*.*\*/|msU", $f, $m);
-
- if ($r) {
- $ll = explode("\n", $m[0]);
- foreach ( $ll as $l ) {
- $l = trim($l,"\t\n\r */");
- if ($l != "") {
- list($k,$v) = array_map("trim", explode(":",$l,2));
- $k= strtolower($k);
- if ($k == "author") {
- $r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
- if ($r) {
- $info['author'][] = ['name'=>$m[1], 'link'=>$m[2]];
- } else {
- $info['author'][] = ['name'=>$v];
- }
- } else {
- if (array_key_exists($k,$info)) {
- $info[$k]=$v;
- }
- }
-
- }
- }
- }
- return $info;
- }
+ if ($r) {
+ $ll = explode("\n", $m[0]);
+ foreach ($ll as $l) {
+ $l = trim($l, "\t\n\r */");
+ if ($l != "") {
+ list($k,$v) = array_map("trim", explode(":", $l, 2));
+ $k= strtolower($k);
+ if ($k == "author") {
+ $r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
+ if ($r) {
+ $info['author'][] = ['name'=>$m[1], 'link'=>$m[2]];
+ } else {
+ $info['author'][] = ['name'=>$v];
+ }
+ } else {
+ if (array_key_exists($k, $info)) {
+ $info[$k]=$v;
+ }
+ }
+ }
+ }
+ }
+ return $info;
+ }
}
diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php
index 973098d460..3f4614b6c7 100644
--- a/src/Database/DBStructure.php
+++ b/src/Database/DBStructure.php
@@ -661,7 +661,7 @@ class DBStructure {
$database = [];
$database["addon"] = [
- "comment" => "registered plugins",
+ "comment" => "registered addons",
"fields" => [
"id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"name" => ["type" => "varchar(190)", "not null" => "1", "default" => "", "comment" => ""],
@@ -1081,7 +1081,7 @@ class DBStructure {
]
];
$database["hook"] = [
- "comment" => "plugin hook registry",
+ "comment" => "addon hook registry",
"fields" => [
"id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"hook" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
From d1b003c69497318bf0b089de0965926c5ca92994 Mon Sep 17 00:00:00 2001
From: Adam Magness
Date: Sat, 20 Jan 2018 09:23:45 -0500
Subject: [PATCH 11/12] Bug fix
remove require for deleted file
---
mod/nogroup.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/mod/nogroup.php b/mod/nogroup.php
index d5da626045..783399f578 100644
--- a/mod/nogroup.php
+++ b/mod/nogroup.php
@@ -14,8 +14,6 @@ function nogroup_init(App $a)
return;
}
- require_once 'include/contact_widgets.php';
-
if (! x($a->page, 'aside')) {
$a->page['aside'] = '';
}
From fb372877f6ec2d01d097c3dbb3a00c4cb19f32fc Mon Sep 17 00:00:00 2001
From: Adam Magness
Date: Sat, 20 Jan 2018 09:45:22 -0500
Subject: [PATCH 12/12] Rename template and doc
Rename admin/plugins.tpl to admin/addons.tpl and update references. Rename doc/de/Plugins.md to Addons.md
---
doc/de/{Plugins.md => Addons.md} | 0
mod/admin.php | 4 ++--
view/templates/admin/{plugins.tpl => addons.tpl} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename doc/de/{Plugins.md => Addons.md} (100%)
rename view/templates/admin/{plugins.tpl => addons.tpl} (100%)
diff --git a/doc/de/Plugins.md b/doc/de/Addons.md
similarity index 100%
rename from doc/de/Plugins.md
rename to doc/de/Addons.md
diff --git a/mod/admin.php b/mod/admin.php
index 0b53dc93d8..4544917010 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -1855,7 +1855,7 @@ function admin_page_addons(App $a)
}
}
- $t = get_markup_template('admin/plugins.tpl');
+ $t = get_markup_template('admin/addons.tpl');
return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Addons'),
@@ -2108,7 +2108,7 @@ function admin_page_themes(App $a)
$addons[] = [$th['name'], (($th['allowed']) ? "on" : "off"), Theme::getInfo($th['name'])];
}
- $t = get_markup_template('admin/plugins.tpl');
+ $t = get_markup_template('admin/addons.tpl');
return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Themes'),
diff --git a/view/templates/admin/plugins.tpl b/view/templates/admin/addons.tpl
similarity index 100%
rename from view/templates/admin/plugins.tpl
rename to view/templates/admin/addons.tpl