From b86b04a81a5c68c1d936bcc6926bf3350a0587aa Mon Sep 17 00:00:00 2001
From: Adam Magness " . file_get_contents("addon/$plugin/README") . "
";
+ if (is_file("addon/$addon/README.md")) {
+ $readme = Markdown::convert(file_get_contents("addon/$addon/README.md"), false);
+ } elseif (is_file("addon/$addon/README")) {
+ $readme = "" . file_get_contents("addon/$addon/README") . "
";
}
$admin_form = "";
- if (in_array($plugin, $a->plugins_admin)) {
- @require_once("addon/$plugin/$plugin.php");
- $func = $plugin . '_plugin_admin';
+ if (in_array($addon, $a->addons_admin)) {
+ @require_once("addon/$addon/$addon.php");
+ $func = $addon . '_plugin_admin';
$func($a, $admin_form);
}
@@ -1798,20 +1798,20 @@ function admin_page_plugins(App $a)
return replace_macros($t, [
'$title' => t('Administration'),
- '$page' => t('Plugins'),
+ '$page' => t('Addons'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => System::baseUrl(true),
- '$plugin' => $plugin,
+ '$addon' => $addon,
'$status' => $status,
'$action' => $action,
- '$info' => Addon::getInfo($plugin),
+ '$info' => Addon::getInfo($addon),
'$str_author' => t('Author: '),
'$str_maintainer' => t('Maintainer: '),
'$admin_form' => $admin_form,
- '$function' => 'plugins',
+ '$function' => 'addons',
'$screenshot' => '',
'$readme' => $readme,
@@ -1820,36 +1820,36 @@ function admin_page_plugins(App $a)
}
/*
- * List plugins
+ * List addons
*/
if (x($_GET, "a") && $_GET['a'] == "r") {
- check_form_security_token_redirectOnErr(System::baseUrl() . '/admin/plugins', 'admin_themes', 't');
+ check_form_security_token_redirectOnErr(System::baseUrl() . '/admin/addons', 'admin_themes', 't');
Addon::reload();
- info("Plugins reloaded");
- goaway(System::baseUrl() . '/admin/plugins');
+ info("Addons reloaded");
+ goaway(System::baseUrl() . '/admin/addons');
}
- $plugins = [];
+ $addons = [];
$files = glob("addon/*/");
if (is_array($files)) {
foreach ($files as $file) {
if (is_dir($file)) {
list($tmp, $id) = array_map("trim", explode("/", $file));
$info = Addon::getInfo($id);
- $show_plugin = true;
+ $show_addon = true;
// If the addon is unsupported, then only show it, when it is enabled
- if ((strtolower($info["status"]) == "unsupported") && !in_array($id, $a->plugins)) {
- $show_plugin = false;
+ if ((strtolower($info["status"]) == "unsupported") && !in_array($id, $a->addons)) {
+ $show_addon = false;
}
// Override the above szenario, when the admin really wants to see outdated stuff
if (Config::get("system", "show_unsupported_addons")) {
- $show_plugin = true;
+ $show_addon = true;
}
- if ($show_plugin) {
- $plugins[] = [$id, (in_array($id, $a->plugins) ? "on" : "off"), $info];
+ if ($show_addon) {
+ $addons[] = [$id, (in_array($id, $a->addons) ? "on" : "off"), $info];
}
}
}
@@ -1858,14 +1858,14 @@ function admin_page_plugins(App $a)
$t = get_markup_template('admin/plugins.tpl');
return replace_macros($t, [
'$title' => t('Administration'),
- '$page' => t('Plugins'),
+ '$page' => t('Addons'),
'$submit' => t('Save Settings'),
- '$reload' => t('Reload active plugins'),
+ '$reload' => t('Reload active addons'),
'$baseurl' => System::baseUrl(true),
- '$function' => 'plugins',
- '$plugins' => $plugins,
- '$pcount' => count($plugins),
- '$noplugshint' => t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
+ '$function' => 'addons',
+ '$addons' => $addons,
+ '$pcount' => count($addons),
+ '$noplugshint' => t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
'$form_security_token' => get_form_security_token("admin_themes"),
]);
}
@@ -1940,7 +1940,7 @@ function rebuild_theme_table($themes)
* themes is generated.
*
* The template used for displaying the list of themes and the details of the
- * themes are the same as used for the plugins.
+ * themes are the same as used for the addons.
*
* The returned string contains the HTML code of the admin panel page.
*
@@ -2071,7 +2071,7 @@ function admin_page_themes(App $a)
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => System::baseUrl(true),
- '$plugin' => $theme,
+ '$addon' => $theme,
'$status' => $status,
'$action' => $action,
'$info' => Theme::getInfo($theme),
@@ -2103,9 +2103,9 @@ function admin_page_themes(App $a)
* List themes
*/
- $plugins = [];
+ $addons = [];
foreach ($themes as $th) {
- $plugins[] = [$th['name'], (($th['allowed']) ? "on" : "off"), Theme::getInfo($th['name'])];
+ $addons[] = [$th['name'], (($th['allowed']) ? "on" : "off"), Theme::getInfo($th['name'])];
}
$t = get_markup_template('admin/plugins.tpl');
@@ -2116,7 +2116,7 @@ function admin_page_themes(App $a)
'$reload' => t('Reload active themes'),
'$baseurl' => System::baseUrl(true),
'$function' => 'themes',
- '$plugins' => $plugins,
+ '$addons' => $addons,
'$pcount' => count($themes),
'$noplugshint' => t('No themes found on the system. They should be placed in %1$s', '/view/themes
'),
'$experimental' => t('[Experimental]'),
diff --git a/mod/friendica.php b/mod/friendica.php
index 7a9f6c6f61..318d309e36 100644
--- a/mod/friendica.php
+++ b/mod/friendica.php
@@ -26,12 +26,12 @@ function friendica_init(App $a) {
$admin = false;
}
- $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'];
}
}
}
@@ -51,7 +51,7 @@ function friendica_init(App $a) {
$data = [
'version' => FRIENDICA_VERSION,
'url' => System::baseUrl(),
- 'plugins' => $visible_plugins,
+ 'addons' => $visible_addons,
'locked_features' => $locked_features,
'register_policy' => $register_policy[$a->config['register_policy']],
'admin' => $admin,
@@ -84,19 +84,19 @@ function friendica_content(App $a) {
$o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
$o .= '
' . t('Installed plugins/addons/apps:') . '
' . PHP_EOL; - $sorted = $visible_plugins; + if (count($visible_addons)) { + $o .= '' . t('Installed addons/addons/apps:') . '
' . PHP_EOL; + $sorted = $visible_addons; $s = ''; sort($sorted); foreach ($sorted as $p) { @@ -109,7 +109,7 @@ function friendica_content(App $a) { } $o .= '' . t('No installed plugins/addons/apps') . '
' . PHP_EOL; + $o .= '' . t('No installed addons/addons/apps') . '
' . 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{{$info.name}} - {{$info.version}} : {{$action}}
+{{$info.name}} - {{$info.version}} : {{$action}}
{{$info.description}}