* About
* =====
*
- * This plugin will allow you to enter a date/time period during which
+ * This addon will allow you to enter a date/time period during which
* all your ~friendica visitors from the web will be redirected to a page
* you can configure in the admin panel as well.
*
* Calls to the API and the communication with other ~friendica nodes is
- * not effected from this plugin.
+ * not effected from this addon.
*
* If you enter a period the current date would be affected none of the
* currently logged in users will be effected as well. But if they log
}
}
-function blackout_plugin_admin(&$a, &$o) {
+function blackout_addon_admin(&$a, &$o) {
$mystart = Config::get('blackout','begindate');
if (! is_string($mystart)) { $mystart = "YYYY-MM-DD:hhmm"; }
$myend = Config::get('blackout','enddate');
$o = '<p>Please double check that the current settings for the blackout. Begin will be <strong>'.$mystart.'</strong> and it will end <strong>'.$myend.'</strong>.</p>' . $o;
}
}
-function blackout_plugin_admin_post (&$a) {
+function blackout_addon_admin_post (&$a) {
$begindate = trim($_POST['startdate']);
$enddate = trim($_POST['enddate']);
$url = trim($_POST['rurl']);
function blockem_install() {
Addon::registerHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
Addon::registerHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
- Addon::registerHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Addon::registerHook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start');
Addon::registerHook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
- Addon::registerHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' );
+ Addon::registerHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store');
}
-
function blockem_uninstall() {
Addon::unregisterHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
Addon::unregisterHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
- Addon::unregisterHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Addon::unregisterHook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start');
Addon::unregisterHook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
- Addon::unregisterHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' );
-
+ Addon::unregisterHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store');
}
-
-
-
-
-function blockem_addon_settings(&$a,&$s) {
+function blockem_addon_settings(&$a, &$s)
+{
if(! local_user())
return;
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n";
- $words = PConfig::get(local_user(),'blockem','words');
+ $words = PConfig::get(local_user(), 'blockem', 'words');
if(! $words)
$words = '';
}
}
-
function blockem_enotify_store(&$a,&$b) {
$words = PConfig::get($b['uid'],'blockem','words');
}
}
-
function blockem_display_item(&$a,&$b) {
if(strstr($b['output']['body'],'id="blockem-wrap-'))
$b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg";
}
-
function blockem_conversation_start(&$a,&$b) {
if(! local_user())
use Friendica\Core\Addon;
use Friendica\Core\PConfig;
-function blogger_install() {
+function blogger_install()
+{
Addon::registerHook('post_local', 'addon/blogger/blogger.php', 'blogger_post_local');
Addon::registerHook('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send');
Addon::registerHook('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets');
Addon::registerHook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
}
-function blogger_uninstall() {
+function blogger_uninstall()
+{
Addon::unregisterHook('post_local', 'addon/blogger/blogger.php', 'blogger_post_local');
Addon::unregisterHook('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send');
Addon::unregisterHook('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets');
// obsolete - remove
Addon::unregisterHook('post_local_end', 'addon/blogger/blogger.php', 'blogger_send');
- Addon::unregisterHook('plugin_settings', 'addon/blogger/blogger.php', 'blogger_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/blogger/blogger.php', 'blogger_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
}
-function blogger_jot_nets(&$a,&$b) {
+function blogger_jot_nets(&$a, &$b)
+{
if (!local_user()) {
return;
}
- $bl_post = PConfig::get(local_user(),'blogger','post');
+ $bl_post = PConfig::get(local_user(), 'blogger', 'post');
if (intval($bl_post) == 1) {
- $bl_defpost = PConfig::get(local_user(),'blogger','post_by_default');
+ $bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default');
$selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="blogger_enable" ' . $selected . ' value="1" /> '
- . t('Post to blogger') . '</div>';
+ . t('Post to blogger') . '</div>';
}
}
-function blogger_settings(&$a,&$s) {
-
+function blogger_settings(&$a, &$s)
+{
if (! local_user()) {
return;
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'blogger','post');
+ $enabled = PConfig::get(local_user(), 'blogger', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(),'blogger','post_by_default');
+ $def_enabled = PConfig::get(local_user(), 'blogger', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$s .= '</span>';
$s .= '<div id="blogger-enable-wrapper">';
- $s .= '<label id="blogger-enable-label" for="blogger-checkbox">' . t('Enable Blogger Post Plugin') . '</label>';
+ $s .= '<label id="blogger-enable-label" for="blogger-checkbox">' . t('Enable Blogger Post Addon') . '</label>';
$s .= '<input id="blogger-checkbox" type="checkbox" name="blogger" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
}
-function blogger_settings_post(&$a,&$b) {
- if (x($_POST,'blogger-submit')) {
- PConfig::set(local_user(),'blogger','post',intval($_POST['blogger']));
- PConfig::set(local_user(),'blogger','post_by_default',intval($_POST['bl_bydefault']));
- PConfig::set(local_user(),'blogger','bl_username',trim($_POST['bl_username']));
- PConfig::set(local_user(),'blogger','bl_password',trim($_POST['bl_password']));
- PConfig::set(local_user(),'blogger','bl_blog',trim($_POST['bl_blog']));
+function blogger_settings_post(&$a, &$b)
+{
+ if (x($_POST, 'blogger-submit')) {
+ PConfig::set(local_user(), 'blogger', 'post', intval($_POST['blogger']));
+ PConfig::set(local_user(), 'blogger', 'post_by_default', intval($_POST['bl_bydefault']));
+ PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username']));
+ PConfig::set(local_user(), 'blogger', 'bl_password', trim($_POST['bl_password']));
+ PConfig::set(local_user(), 'blogger', 'bl_blog', trim($_POST['bl_blog']));
}
}
-function blogger_post_local(&$a,&$b) {
+function blogger_post_local(&$a, &$b)
+{
// This can probably be changed to allow editing by pointing to a different API endpoint
if ($b['edit']) {
return;
}
- $bl_post = intval(PConfig::get(local_user(),'blogger','post'));
+ $bl_post = intval(PConfig::get(local_user(), 'blogger', 'post'));
- $bl_enable = (($bl_post && x($_REQUEST,'blogger_enable')) ? intval($_REQUEST['blogger_enable']) : 0);
+ $bl_enable = (($bl_post && x($_REQUEST, 'blogger_enable')) ? intval($_REQUEST['blogger_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'blogger','post_by_default'))) {
+ if ($b['api_source'] && intval(PConfig::get(local_user(), 'blogger', 'post_by_default'))) {
$bl_enable = 1;
}
-function blogger_send(&$a,&$b) {
+function blogger_send(&$a, &$b)
+{
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
return;
}
- if (! strstr($b['postopts'],'blogger')) {
+ if (! strstr($b['postopts'], 'blogger')) {
return;
}
return;
}
- $bl_username = xmlify(PConfig::get($b['uid'],'blogger','bl_username'));
- $bl_password = xmlify(PConfig::get($b['uid'],'blogger','bl_password'));
- $bl_blog = PConfig::get($b['uid'],'blogger','bl_blog');
+ $bl_username = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username'));
+ $bl_password = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password'));
+ $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog');
if ($bl_username && $bl_password && $bl_blog) {
-
require_once('include/bbcode.php');
$title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>';
logger('blogger: data: ' . $xml, LOGGER_DATA);
if ($bl_blog !== 'test') {
- $x = post_url($bl_blog,$xml);
+ $x = post_url($bl_blog, $xml);
}
logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG);
}
-}
\ No newline at end of file
+}
return $o;
}
-function buffer_plugin_admin(&$a, &$o){
- $t = get_markup_template( "admin.tpl", "addon/buffer/" );
+function buffer_addon_admin(&$a, &$o)
+{
+ $t = get_markup_template("admin.tpl", "addon/buffer/");
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
- // name, label, value, help, [extra values]
- '$client_id' => ['client_id', t('Client ID'), Config::get('buffer', 'client_id' ), ''],
- '$client_secret' => ['client_secret', t('Client Secret'), Config::get('buffer', 'client_secret' ), ''],
+ // name, label, value, help, [extra values]
+ '$client_id' => ['client_id', t('Client ID'), Config::get('buffer', 'client_id'), ''],
+ '$client_secret' => ['client_secret', t('Client Secret'), Config::get('buffer', 'client_secret'), ''],
]);
}
-function buffer_plugin_admin_post(&$a){
- $client_id = ((x($_POST,'client_id')) ? notags(trim($_POST['client_id'])) : '');
- $client_secret = ((x($_POST,'client_secret')) ? notags(trim($_POST['client_secret'])): '');
- Config::set('buffer','client_id',$client_id);
- Config::set('buffer','client_secret',$client_secret);
- info( t('Settings updated.'). EOL );
+function buffer_addon_admin_post(&$a)
+{
+ $client_id = ((x($_POST, 'client_id')) ? notags(trim($_POST['client_id'])) : '');
+ $client_secret = ((x($_POST, 'client_secret')) ? notags(trim($_POST['client_secret'])): '');
+ Config::set('buffer', 'client_id', $client_id);
+ Config::set('buffer', 'client_secret', $client_secret);
+ info(t('Settings updated.'). EOL);
}
function buffer_connect(&$a) {
$s .= '</div><div class="clear"></div>';
} else {
$s .= '<div id="buffer-enable-wrapper">';
- $s .= '<label id="buffer-enable-label" for="buffer-checkbox">' . t('Enable Buffer Post Plugin') . '</label>';
+ $s .= '<label id="buffer-enable-label" for="buffer-checkbox">' . t('Enable Buffer Post Addon') . '</label>';
$s .= '<input id="buffer-checkbox" type="checkbox" name="buffer" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
];
}
-function communityhome_plugin_admin(&$a, &$o) {
- $tpl = get_markup_template( 'settings.tpl', 'addon/communityhome/' );
+function communityhome_addon_admin(&$a, &$o)
+{
+ $tpl = get_markup_template('settings.tpl', 'addon/communityhome/');
$opts = communityhome_getopts();
$ctx = [
'$submit' => t("Submit"),
'$fields' => [],
];
- foreach($opts as $k=>$v) {
+
+ foreach ($opts as $k => $v) {
$ctx['fields'][] = ['communityhome_'.$k, $v, Config::get('communityhome', $k)];
}
$o = replace_macros($tpl, $ctx);
}
-function communityhome_plugin_admin_post(&$a,&$b) {
- if(x($_POST,'communityhome-submit')) {
+function communityhome_addon_admin_post(&$a, &$b)
+{
+ if (x($_POST, 'communityhome-submit')) {
$opts = communityhome_getopts();
- foreach($opts as $k=>$v) {
- Config::set('communityhome', $k, x($_POST,'communityhome_'.$k));
+ foreach ($opts as $k => $v) {
+ Config::set('communityhome', $k, x($_POST, 'communityhome_'.$k));
}
}
}
return $r;
}
-function curweather_install() {
+function curweather_install()
+{
Addon::registerHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
- Addon::registerHook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
- Addon::registerHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
+ Addon::registerHook('addon_settings', 'addon/curweather/curweather.php', 'curweather_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post');
}
function curweather_uninstall() {
Addon::unregisterHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
- Addon::unregisterHook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/curweather/curweather.php', 'curweather_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post');
}
function curweather_network_mod_init(&$fk_app,&$b) {
}
-function curweather_plugin_settings_post($a,$post) {
+function curweather_addon_settings_post($a,$post) {
if(! local_user() || (! x($_POST,'curweather-settings-submit')))
return;
PConfig::set(local_user(),'curweather','curweather_loc',trim($_POST['curweather_loc']));
}
-function curweather_plugin_settings(&$a,&$s) {
+function curweather_addon_settings(&$a,&$s) {
if(! local_user())
return;
}
// Config stuff for the admin panel to let the admin of the node set a APPID
// for accessing the API of openweathermap
-function curweather_plugin_admin_post (&$a) {
+function curweather_addon_admin_post (&$a) {
if(! is_site_admin())
return;
if ($_POST['curweather-submit']) {
info( t('Curweather settings saved.'.EOL));
}
}
-function curweather_plugin_admin (&$a, &$o) {
+function curweather_addon_admin (&$a, &$o) {
if(! is_site_admin())
return;
$appid = Config::get('curweather','appid');
}
}
} catch (DAVVersionMismatchException $e) {
- $x = t("The current version of this plugin has not been set up correctly. Please contact the system administrator of your installation of friendica to fix this.");
+ $x = t("The current version of this addon has not been set up correctly. Please contact the system administrator of your installation of friendica to fix this.");
}
return $x;
}
* @param App $a
* @param null|object $o
*/
-function dav_plugin_admin_post(&$a = null, &$o = null)
+function dav_addon_admin_post(&$a = null, &$o = null)
{
- check_form_security_token_redirectOnErr('/admin/plugins/dav', 'dav_admin_save');
+ check_form_security_token_redirectOnErr('/admin/addons/dav', 'dav_admin_save');
dav_include_files();
require_once(__DIR__ . "/database-init.inc.php");
* @param App $a
* @param string $o
*/
-function dav_plugin_admin(&$a, &$o)
+function dav_addon_admin(&$a, &$o)
{
dav_include_files();
require_once(__DIR__ . "/database-init.inc.php");
function fromapp_install() {
Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
- Addon::registerHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
- Addon::registerHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
+ Addon::registerHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
+ Addon::registerHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
logger("installed fromapp");
}
function fromapp_uninstall() {
Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
logger("removed fromapp");
Addon::unregisterHook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron');
// Old hooks
- Addon::unregisterHook('plugin_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
}
function fromgplus_addon_settings(&$a,&$s) {
}
}
-function fromgplus_plugin_admin(&$a, &$o){
- $t = get_markup_template("admin.tpl", "addon/fromgplus/");
+function fromgplus_addon_admin(&$a, &$o)
+{
+ $t = get_markup_template("admin.tpl", "addon/fromgplus/");
- $o = replace_macros($t, [
- '$submit' => t('Save Settings'),
- '$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')],
- ]);
+ $o = replace_macros($t, [
+ '$submit' => t('Save Settings'),
+ '$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')],
+ ]);
}
-function fromgplus_plugin_admin_post(&$a){
- $key = ((x($_POST,'key')) ? trim($_POST['key']) : '');
- Config::set('fromgplus','key',$key);
- info( t('Settings updated.'). EOL );
+function fromgplus_addon_admin_post(&$a)
+{
+ $key = ((x($_POST, 'key')) ? trim($_POST['key']) : '');
+ Config::set('fromgplus', 'key', $key);
+ info(t('Settings updated.'). EOL);
}
function fromgplus_cron($a,$b) {
geocoordinates_resolve_item($item);
}
-function geocoordinates_plugin_admin(&$a, &$o)
+function geocoordinates_addon_admin(&$a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/geocoordinates/");
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
- '$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key' ), ''],
- '$language' => ['language', t('Language code (IETF format)'), Config::get('geocoordinates', 'language' ), ''],
+ '$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key'), ''],
+ '$language' => ['language', t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''],
]);
}
-function geocoordinates_plugin_admin_post(&$a)
+function geocoordinates_addon_admin_post(&$a)
{
- $api_key = ((x($_POST,'api_key')) ? notags(trim($_POST['api_key'])) : '');
- Config::set('geocoordinates','api_key',$api_key);
+ $api_key = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key'])) : '');
+ Config::set('geocoordinates', 'api_key', $api_key);
- $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
- Config::set('geocoordinates','language',$language);
+ $language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : '');
+ Config::set('geocoordinates', 'language', $language);
info(t('Settings updated.'). EOL);
}
* $a->config['geonames']['username'] = 'your_username';
* Also visit http://geonames.org/manageaccount and enable access to the free web services
*
- * When plugin is installed, the system calls the plugin
+ * When addon is installed, the system calls the addon
* name_install() function, located in 'addon/name/name.php',
* where 'name' is the name of the addon.
* If the addon is removed from the configuration list, the
/**
*
- * Our plugin will attach in three places.
+ * Our addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
/**
*
- * Then we'll attach into the plugin settings page, and also the
+ * Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
* user preferences.
*
*/
- Addon::registerHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
- Addon::registerHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
+ Addon::registerHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin');
+ Addon::registerHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post');
logger("installed geonames");
}
*/
Addon::unregisterHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
- Addon::unregisterHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
+ Addon::unregisterHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin');
+ Addon::unregisterHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post');
logger("removed geonames");
* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
- * - The profile owner must have allowed our plugin
+ * - The profile owner must have allowed our addon
*
*/
*
*/
-function geonames_plugin_admin_post($a,$post) {
+function geonames_addon_admin_post($a,$post) {
if(! local_user() || (! x($_POST,'geonames-submit')))
return;
PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames']));
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
-function geonames_plugin_admin(&$a,&$s) {
+function geonames_addon_admin(&$a,&$s) {
if(! local_user())
return;
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Geonames Settings') . '</h3>';
$s .= '<div id="geonames-enable-wrapper">';
- $s .= '<label id="geonames-enable-label" for="geonames-checkbox">' . t('Enable Geonames Plugin') . '</label>';
+ $s .= '<label id="geonames-enable-label" for="geonames-checkbox">' . t('Enable Geonames Addon') . '</label>';
$s .= '<input id="geonames-checkbox" type="checkbox" name="geonames" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
function gnot_install() {
- Addon::registerHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
- Addon::registerHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
+ Addon::registerHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings');
+ Addon::registerHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
logger("installed gnot");
function gnot_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
$s .= '<h3>' . t('Gnot Settings') . '</h3>';
$s .= '<div id="gnot-wrapper">';
$s .= '<div id="gnot-desc">' . t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") . '</div>';
- $s .= '<label id="gnot-label" for="gnot">' . t('Enable this plugin/addon?') . '</label>';
+ $s .= '<label id="gnot-label" for="gnot">' . t('Enable this addon?') . '</label>';
$s .= '<input id="gnot-input" type="checkbox" name="gnot" value="1"'. $gnot_checked . '/>';
$s .= '</div><div class="clear"></div>';
<?php
/**
* Name: Gravatar Support
- * Description: If there is no avatar image for a new user or contact this plugin will look for one at Gravatar.
+ * Description: If there is no avatar image for a new user or contact this addon will look for one at Gravatar.
* Version: 1.1
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
*/
use Friendica\Core\Config;
/**
- * Installs the plugin hook
+ * Installs the addon hook
*/
function gravatar_install() {
Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
}
/**
- * Removes the plugin hook
+ * Removes the addon hook
*/
function gravatar_uninstall() {
Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
/**
* Display admin settings for this addon
*/
-function gravatar_plugin_admin (&$a, &$o) {
+function gravatar_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/gravatar/" );
$default_avatar = Config::get('gravatar', 'default_img');
/**
* Save admin settings
*/
-function gravatar_plugin_admin_post (&$a) {
+function gravatar_addon_admin_post (&$a) {
check_form_security_token('gravatarsave');
$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon');
function group_text_install() {
- Addon::registerHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
- Addon::registerHook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
+ Addon::registerHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
+ Addon::registerHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
logger("installed group_text");
}
function group_text_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
logger("removed group_text");
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
<?php
/**
* Name: Impressum
- * Description: Plugin to add contact information to the about page (/friendica)
+ * Description: Addon to add contact information to the about page (/friendica)
* Version: 1.3
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* License: 3-clause BSD license
function impressum_install() {
Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
- logger("installed impressum plugin");
+ logger("installed impressum Addon");
}
function impressum_uninstall() {
Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
- logger("uninstalled impressum plugin");
+ logger("uninstalled impressum Addon");
}
function impressum_module() {
}
}
-function impressum_plugin_admin_post (&$a) {
+function impressum_addon_admin_post (&$a) {
$owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : '');
$ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : '');
$postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : '');
Config::set('impressum','footer_text',strip_tags($footer_text));
info( t('Settings updated.'). EOL );
}
-function impressum_plugin_admin (&$a, &$o) {
+function impressum_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/impressum/" );
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
<?php
/**
-* Name: IRC Chat Plugin
+* Name: IRC Chat Addon
* Description: add an Internet Relay Chat chatroom on freenode
* Version: 1.1
* Author: tony baldwin <https://free-haven.org/profile/tony>
function irc_install() {
Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
- Addon::registerHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
}
function irc_uninstall() {
Addon::unregisterHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
- Addon::unregisterHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
+ Addon::unregisterHook('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings');
}
}
-function irc_plugin_admin_post (&$a) {
+function irc_addon_admin_post (&$a) {
if(! is_site_admin())
return;
info( t('IRC settings saved.') . EOL);
}
}
-function irc_plugin_admin (&$a, &$o) {
+function irc_addon_admin (&$a, &$o) {
$sitechats = Config::get('irc','sitechats'); /* popular channels */
$autochans = Config::get('irc','autochans'); /* auto connect chans */
$t = get_markup_template( "admin.tpl", "addon/irc/" );
function jappixmini_install()
{
- Addon::registerHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
- Addon::registerHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
+ Addon::registerHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
+ Addon::registerHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
function jappixmini_uninstall()
{
- Addon::unregisterHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
}
-function jappixmini_plugin_admin(App $a, &$o)
+function jappixmini_addon_admin(App $a, &$o)
{
// display instructions and warnings on addon settings page for admin
if (!file_exists("addon/jappixmini.tgz")) {
$o .= '<input type="submit" name="jappixmini-admin-settings" value="OK" />';
}
-function jappixmini_plugin_admin_post(App $a)
+function jappixmini_addon_admin_post(App $a)
{
// set info text
$submit = $_REQUEST['jappixmini-admin-settings'];
}
- // do not return an address if user deactivated plugin
+ // do not return an address if user deactivated addon
$activated = PConfig::get($uid, 'jappixmini', 'activate');
if (!$activated) {
killme();
/**
*
- * Our demo plugin will attach in three places.
+ * Our demo addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
/**
*
- * Then we'll attach into the plugin settings page, and also the
+ * Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
* user preferences.
*
*/
- Addon::registerHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
- Addon::registerHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+ Addon::registerHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+ Addon::registerHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
logger("installed krynn");
}
*/
Addon::unregisterHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
logger("removed krynn");
* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
- * - The profile owner must have allowed our plugin
+ * - The profile owner must have allowed our addon
*
*/
/**
*
- * Called from the Plugin Setting form.
+ * Called from the addon Setting form.
* Add our own settings info to the page.
*
*/
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Krynn Settings') . '</h3>';
$s .= '<div id="krynn-enable-wrapper">';
- $s .= '<label id="krynn-enable-label" for="krynn-checkbox">' . t('Enable Krynn Plugin') . '</label>';
+ $s .= '<label id="krynn-enable-label" for="krynn-checkbox">' . t('Enable Krynn Addon') . '</label>';
$s .= '<input id="krynn-checkbox" type="checkbox" name="krynn" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div></div>';
/* provide a submit button */
function langfilter_install()
{
Addon::registerHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body', 10);
- Addon::registerHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
}
function langfilter_uninstall()
{
Addon::unregisterHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body');
- Addon::unregisterHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
}
/* The settings
<?php
/**
* Name: Libravatar Support
- * Description: If there is no avatar image for a new user or contact this plugin will look for one at Libravatar. Please disable Gravatar addon if you use this one. (requires PHP >= 5.3)
+ * Description: If there is no avatar image for a new user or contact this addon will look for one at Libravatar. Please disable Gravatar addon if you use this one. (requires PHP >= 5.3)
* Version: 1.1
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
*/
use Friendica\Core\Config;
/**
- * Installs the plugin hook
+ * Installs the addon hook
*/
function libravatar_install() {
if (! version_compare(PHP_VERSION, '5.3.0', '>=')) {
}
/**
- * Removes the plugin hook
+ * Removes the addon hook
*/
function libravatar_uninstall() {
Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
/**
* Display admin settings for this addon
*/
-function libravatar_plugin_admin (&$a, &$o) {
+function libravatar_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/libravatar" );
$default_avatar = Config::get('libravatar', 'default_img');
/**
* Save admin settings
*/
-function libravatar_plugin_admin_post (&$a) {
+function libravatar_addon_admin_post (&$a) {
check_form_security_token('libravatarrsave');
$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon');
use Friendica\Database\DBM;
function mailstream_install() {
- Addon::registerHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
- Addon::registerHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post');
+ Addon::registerHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post');
Addon::registerHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Addon::registerHook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Addon::registerHook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron');
}
function mailstream_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post');
Addon::unregisterHook('post_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook');
Addon::unregisterHook('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook');
Addon::unregisterHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook');
function mailstream_module() {}
-function mailstream_plugin_admin(&$a,&$o) {
+function mailstream_addon_admin(&$a,&$o) {
$frommail = Config::get('mailstream', 'frommail');
$template = get_markup_template('admin.tpl', 'addon/mailstream/');
$config = ['frommail',
'$submit' => t('Save Settings')]);
}
-function mailstream_plugin_admin_post ($a) {
+function mailstream_addon_admin_post ($a) {
if (x($_POST, 'frommail')) {
Config::set('mailstream', 'frommail', $_POST['frommail']);
}
}
$mail = new PHPmailer;
try {
- $mail->XMailer = 'Friendica Mailstream Plugin';
+ $mail->XMailer = 'Friendica Mailstream Addon';
$mail->SetFrom($frommail, mailstream_sender($item));
$mail->AddAddress($address, $user['username']);
$mail->MessageID = $message_id;
mailstream_tidy();
}
-function mailstream_plugin_settings(&$a,&$s) {
+function mailstream_addon_settings(&$a,&$s) {
$enabled = PConfig::get(local_user(), 'mailstream', 'enabled');
$address = PConfig::get(local_user(), 'mailstream', 'address');
$nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes');
'$submit' => t('Save Settings')]);
}
-function mailstream_plugin_settings_post($a,$post) {
+function mailstream_addon_settings_post($a,$post) {
if ($_POST['mailstream_address'] != "") {
PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']);
}
function mathjax_install() {
Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
- Addon::registerHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
- Addon::registerHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
- logger('installed js_math plugin');
+ Addon::registerHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
+ Addon::registerHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
+ logger('installed js_math addon');
}
function mathjax_uninstall() {
Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
- Addon::unregisterHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
}
function mathjax_settings_post ($a, $post) {
if (! local_user())
}
}
}
-function mathjax_plugin_admin_post (&$a) {
+function mathjax_addon_admin_post (&$a) {
$baseurl = ((x($_POST, 'baseurl')) ? trim($_POST['baseurl']) : 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML');
Config::set('mathjax','baseurl',$baseurl);
info( t('Settings updated.'). EOL);
}
-function mathjax_plugin_admin (&$a, &$o) {
+function mathjax_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/mathjax/" );
if (Config::get('mathjax','baseurl','') == '') {
Config::set('mathjax','baseurl','http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML');
<?php
-
/**
* Name: MemberSince
* Description: Display membership date in profile
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
- *
+ *
*/
use Friendica\Core\Addon;
-require_once('include/datetime.php');
+require_once 'include/datetime.php';
+
+function membersince_install()
+{
+ Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
+}
-function membersince_install(){ Addon::registerHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
+function membersince_uninstall()
+{
+ Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
+}
-function membersince_uninstall(){ Addon::unregisterHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
+function membersince_display(&$a, &$b)
+{
+ // Works in Vier
+ $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . t('Member since:') . "</dt>\n<dd>" . datetime_convert('UTC', date_default_timezone_get(), $a->profile['register_date']) . "</dd>\n</dl>", $b, 1);
-function membersince_display(&$a,&$b) {
-$b = preg_replace('/<\/dl>/',"</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . t('Member since:') . "</dt>\n<dd>" . datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date']) . "</dd>\n</dl>" ,$b, 1);
-//$b = str_replace('</div>' . "\n" . '<div id="advanced-profile-name-end"></div>',sprintf( t(' - Member since: %s') . EOL, datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date'])) . '</div>' . "\n" . '<div id="advanced-profile-name-end"></div>',$b);
-}
\ No newline at end of file
+ // Trying for Frio
+ //$b = preg_replace('/<\/div>/', "<div id=\"aprofile-membersince\" class=\"aprofile\"><hr class=\"profile-separator\"><div class=\"profile-label-name\">" . t('Member since:') . "</div><div class=\"profile-entry\">" . datetime_convert('UTC', date_default_timezone_get(), $a->profile['register_date']) . "</div></div>", $b, 1);
+}
}
}
-function newmemberwidget_plugin_admin_post( &$a ) {
+function newmemberwidget_addon_admin_post( &$a ) {
$ft = ((x($_POST, 'freetext')) ? trim($_POST['freetext']) : "");
$lsn = ((x($_POST, 'localsupportname')) ? notags(trim($_POST['localsupportname'])) : "");
$gs = intval($_POST['linkglobalsupport']);
Config::set ( 'newmemberwidget', 'localsupport', trim($lsn));
}
-function newmemberwidget_plugin_admin(&$a, &$o){
+function newmemberwidget_addon_admin(&$a, &$o){
$t = get_markup_template('admin.tpl','addon/newmemberwidget');
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
function notifyall_module() {}
-function notifyall_plugin_admin(&$a, &$o) {
+function notifyall_addon_admin(&$a, &$o) {
$o = '<div></div> <a href="' . z_root() . '/notifyall">' . t('Send email to all members') . '</a></br/>';
function notimeline_install() {
- Addon::registerHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
- Addon::registerHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
+ Addon::registerHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
+ Addon::registerHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
}
function notimeline_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
}
function nsfw_install() {
Addon::registerHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body', 10);
- Addon::registerHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
}
function nsfw_uninstall() {
Addon::unregisterHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body');
- Addon::unregisterHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
}
$s .= '</span>';
$s .= '<div id="nsfw-wrapper">';
- $s .= '<p>' . t ('This plugin looks in posts for the words/text you specify below, and collapses any content containing those keywords so it is not displayed at inappropriate times, such as sexual innuendo that may be improper in a work setting. It is polite and recommended to tag any content containing nudity with #NSFW. This filter can also match any other word/text you specify, and can thereby be used as a general purpose content filter.') . '</p>';
+ $s .= '<p>' . t ('This addon looks in posts for the words/text you specify below, and collapses any content containing those keywords so it is not displayed at inappropriate times, such as sexual innuendo that may be improper in a work setting. It is polite and recommended to tag any content containing nudity with #NSFW. This filter can also match any other word/text you specify, and can thereby be used as a general purpose content filter.') . '</p>';
$s .= '<label id="nsfw-enable-label" for="nsfw-enable">' . t('Enable Content filter') . ' </label>';
$s .= '<input id="nsfw-enable" type="checkbox" name="nsfw-enable" value="1"' . $enable_checked . ' />';
$s .= '<div class="clear"></div>';
function numfriends_install() {
- Addon::registerHook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
- Addon::registerHook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
+ Addon::registerHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
+ Addon::registerHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
logger("installed numfriends");
}
function numfriends_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
logger("removed numfriends");
}
-
-
/**
*
* Callback from the settings post function.
* and if so set our configuration setting for this person.
*
*/
-
function numfriends_settings_post($a,$post) {
if(! local_user() || (! x($_POST,'numfriends-submit')))
return;
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
-
-
-
function numfriends_settings(&$a, &$s)
{
if (! local_user()) {
}
-function openstreetmap_plugin_admin(&$a, &$o)
+function openstreetmap_addon_admin(&$a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/openstreetmap/");
$tmsserver = Config::get('openstreetmap', 'tmsserver');
]);
}
-function openstreetmap_plugin_admin_post(&$a)
+function openstreetmap_addon_admin_post(&$a)
{
$urltms = ((x($_POST, 'tmsserver')) ? notags(trim($_POST['tmsserver'])) : '');
$urlnom = ((x($_POST, 'nomserver')) ? notags(trim($_POST['nomserver'])) : '');
function pageheader_install() {
Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
- Addon::registerHook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
}
function pageheader_uninstall() {
Addon::unregisterHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
- Addon::unregisterHook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
// hook moved, uninstall the old one if still there.
Addon::unregisterHook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
<?php
/**
* Name: Piwik Analytics
- * Description: Piwik Analytics Plugin for Friendica
+ * Description: Piwik Analytics Addon for Friendica
* Version: 1.3
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* Author: Klaus Weidenbach
*/
-/* Piwik Analytics Plugin for Friendica
+/* Piwik Analytics Addon for Friendica
*
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
function piwik_install() {
Addon::registerHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
- logger("installed piwik plugin");
+ logger("installed piwik addon");
}
function piwik_uninstall() {
Addon::unregisterHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
- logger("uninstalled piwik plugin");
+ logger("uninstalled piwik addon");
}
function piwik_analytics($a,&$b) {
/*
- * styling of every HTML block added by this plugin is done in the
+ * styling of every HTML block added by this addon is done in the
* associated CSS file. We just have to tell Friendica to get it
* into the page header.
*/
$b .= "</div>";
}
}
-function piwik_plugin_admin (&$a, &$o) {
+function piwik_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/piwik/" );
$o = replace_macros( $t, [
'$submit' => t('Save Settings'),
'$async' => ['async', t('Asynchronous tracking'), Config::get('piwik','async' ), ''],
]);
}
-function piwik_plugin_admin_post (&$a) {
+function piwik_addon_admin_post (&$a) {
$url = ((x($_POST, 'baseurl')) ? notags(trim($_POST['baseurl'])) : '');
$id = ((x($_POST, 'siteid')) ? trim($_POST['siteid']) : '');
$optout = ((x($_POST, 'optout')) ? trim($_POST['optout']) : '');
<?php
/**
* Name: Random Planet, Empirial Version
- * Description: Sample Friendica plugin/addon. Set a random planet from the Emprire when posting.
+ * Description: Sample Friendica addon. Set a random planet from the Emprire when posting.
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* Author: Tony Baldwin <https://free-haven.org/profile/tony>
/**
*
- * Our demo plugin will attach in three places.
+ * Our demo addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
/**
*
- * Then we'll attach into the plugin settings page, and also the
+ * Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
* user preferences.
*
*/
- Addon::registerHook('plugin_settings', 'addon/planets/planets.php', 'planets_settings');
- Addon::registerHook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
+ Addon::registerHook('addon_settings', 'addon/planets/planets.php', 'planets_settings');
+ Addon::registerHook('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
logger("installed planets");
}
*/
Addon::unregisterHook('post_local', 'addon/planets/planets.php', 'planets_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/planets/planets.php', 'planets_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/planets/planets.php', 'planets_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
logger("removed planets");
* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
- * - The profile owner must have allowed our plugin
+ * - The profile owner must have allowed our addon
*
*/
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Planets Settings') . '</h3>';
$s .= '<div id="planets-enable-wrapper">';
- $s .= '<label id="planets-enable-label" for="planets-checkbox">' . t('Enable Planets Plugin') . '</label>';
+ $s .= '<label id="planets-enable-label" for="planets-checkbox">' . t('Enable Planets Addon') . '</label>';
$s .= '<input id="planets-checkbox" type="checkbox" name="planets" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div></div>';
function pledgie_install() {
Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');
- Addon::registerHook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
}
function pledgie_uninstall() {
Addon::unregisterHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');
- Addon::unregisterHook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
}
function pledgie_addon_settings(&$a,&$s) {
<?php
/**
* Name: public_server
- * Description: Friendica plugin/addon with functions suitable for a public server.
+ * Description: Friendica addon with functions suitable for a public server.
* Version: 1.1
* Author: Keith Fernie <http://friendika.me4.it/profile/keith>
*/
);
}
-function public_server_plugin_admin_post ( &$a ) {
- check_form_security_token_redirectOnErr('/admin/plugins/publicserver', 'publicserver');
+function public_server_addon_admin_post ( &$a ) {
+ check_form_security_token_redirectOnErr('/admin/addons/publicserver', 'publicserver');
$expiredays = (( x($_POST, 'expiredays') ) ? notags(trim($_POST['expiredays'] )) : '');
$expireposts = (( x($_POST, 'expireposts') ) ? notags(trim($_POST['expireposts'] )) : '');
$nologin = (( x($_POST, 'nologin') ) ? notags(trim($_POST['nologin'] )) : '');
Config::set( 'public_server','flagpostsexpire',$flagpostsexpire );
info( t('Settings saved').EOL );
}
-function public_server_plugin_admin ( &$a, &$o) {
+function public_server_addon_admin ( &$a, &$o) {
$token = get_form_security_token("publicserver");
$t = get_markup_template( "admin.tpl", "addon/public_server");
$o = replace_macros($t, [
*
* Provides a set of text "snippets" which can be inserted into a comment window by clicking on them.
* First enable the addon in the system admin panel.
- * Then each person can tailor their choice of words in Settings->Plugin Settings in the Qcomment
+ * Then each person can tailor their choice of words in Settings->Addon Settings in the Qcomment
* pane. Initially no qcomments are provided, but on viewing the settings page, a default set of
* of words is suggested. These can be accepted (click Submit) or edited first. Each text line represents
* a different qcomment.
use Friendica\Core\PConfig;
function qcomment_install() {
- Addon::registerHook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
}
function qcomment_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
}
<?php
/**
* Name: Random place
- * Description: Sample Friendica plugin/addon. Set a random place when posting.
+ * Description: Sample Friendica addon. Set a random place when posting.
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*
* Addons are registered with the system through the admin
* panel.
*
- * When registration is detected, the system calls the plugin
+ * When registration is detected, the system calls the addon
* name_install() function, located in 'addon/name/name.php',
* where 'name' is the name of the addon.
* If the addon is removed from the configuration list, the
/**
*
- * Our demo plugin will attach in three places.
+ * Our demo addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
/**
*
- * Then we'll attach into the plugin settings page, and also the
+ * Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
* user preferences.
*
*/
- Addon::registerHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
- Addon::registerHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+ Addon::registerHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings');
+ Addon::registerHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
logger("installed randplace");
}
*/
Addon::unregisterHook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
logger("removed randplace");
* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
- * - The profile owner must have allowed our plugin
+ * - The profile owner must have allowed our addon
*
*/
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Randplace Settings') . '</h3>';
$s .= '<div id="randplace-enable-wrapper">';
- $s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . t('Enable Randplace Plugin') . '</label>';
+ $s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . t('Enable Randplace Addon') . '</label>';
$s .= '<input id="randplace-checkbox" type="checkbox" name="randplace" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
function remote_permissions_install() {
Addon::registerHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content');
- Addon::registerHook('plugin_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
- Addon::registerHook('plugin_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
+ Addon::registerHook('addon_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
+ Addon::registerHook('addon_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
}
function remote_permissions_uninstall() {
Addon::unregisterHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content');
- Addon::unregisterHook('plugin_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
}
function remote_permissions_settings(&$a,&$o) {
return;
}
-function remote_permissions_plugin_admin(&$a, &$o){
+function remote_permissions_addon_admin(&$a, &$o){
$t = get_markup_template( "admin.tpl", "addon/remote_permissions/" );
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
]);
}
-function remote_permissions_plugin_admin_post(&$a){
+function remote_permissions_addon_admin_post(&$a){
$choice = ((x($_POST,'remotepermschoice')) ? notags(trim($_POST['remotepermschoice'])) : '');
Config::set('remote_perms','global',($choice == 1 ? 1 : 0));
info( t('Settings updated.'). EOL );
function securemail_install() {
- Addon::registerHook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings');
- Addon::registerHook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
+ Addon::registerHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings');
+ Addon::registerHook('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
Addon::registerHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare');
}
function securemail_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
Addon::unregisterHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare');
/**
* @brief Build user settings form
*
- * @link https://github.com/friendica/friendica/blob/develop/doc/Plugins.md#plugin_settings 'plugin_settings' hook
+ * @link https://github.com/friendica/friendica/blob/develop/doc/Addons.md#addon_settings 'addon_settings' hook
*
* @param App $a App instance
* @param string $s output html
/**
* @brief Handle data from user settings form
*
- * @link https://github.com/friendica/friendica/blob/develop/doc/Plugins.md#plugin_settings_post 'plugin_settings_post' hook
+ * @link https://github.com/friendica/friendica/blob/develop/doc/Addons.md#addon_settings_post 'addon_settings_post' hook
*
* @param App $a App instance
* @param array $b hook data
/**
* @brief Encrypt notification emails text
*
- * @link https://github.com/friendica/friendica/blob/develop/doc/Plugins.md#emailer_send_prepare 'emailer_send_prepare' hook
+ * @link https://github.com/friendica/friendica/blob/develop/doc/Addons.md#emailer_send_prepare 'emailer_send_prepare' hook
*
* @param App $a App instance
* @param array $b hook data
function showmore_install() {
Addon::registerHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
- Addon::registerHook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
}
function showmore_uninstall() {
Addon::unregisterHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
- Addon::unregisterHook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
}
function showmore_addon_settings(&$a,&$s) {
function startpage_install() {
Addon::registerHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
- Addon::registerHook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
- Addon::registerHook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
+ Addon::registerHook('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings');
+ Addon::registerHook('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
}
function startpage_uninstall() {
Addon::unregisterHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
- Addon::unregisterHook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
}
/**
*
- * Called from the Plugin Setting form.
+ * Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
// old setting - remove only
Addon::unregisterHook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
}
function statusnet_check_item_notification(App $a, &$notification_data)
}
}
-function statusnet_plugin_admin_post(App $a)
+function statusnet_addon_admin_post(App $a)
{
$sites = [];
$sites = Config::set('statusnet', 'sites', $sites);
}
-function statusnet_plugin_admin(App $a, &$o)
+function statusnet_addon_admin(App $a, &$o)
{
$sites = Config::get('statusnet', 'sites');
$sitesform = [];
function superblock_install() {
- Addon::registerHook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post');
Addon::registerHook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start');
Addon::registerHook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu');
Addon::registerHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store');
function superblock_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post');
Addon::unregisterHook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start');
Addon::unregisterHook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu');
Addon::unregisterHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store');
return $o;
}
-function tumblr_plugin_admin(&$a, &$o){
+function tumblr_addon_admin(&$a, &$o){
$t = get_markup_template( "admin.tpl", "addon/tumblr/" );
$o = replace_macros($t, [
]);
}
-function tumblr_plugin_admin_post(&$a){
+function tumblr_addon_admin_post(&$a){
$consumer_key = ((x($_POST,'consumer_key')) ? notags(trim($_POST['consumer_key'])) : '');
$consumer_secret = ((x($_POST,'consumer_secret')) ? notags(trim($_POST['consumer_secret'])): '');
Config::set('tumblr','consumer_key',$consumer_key);
$s .= '</div><div class="clear"></div>';
$s .= '<div id="tumblr-enable-wrapper">';
- $s .= '<label id="tumblr-enable-label" for="tumblr-checkbox">' . t('Enable Tumblr Post Plugin') . '</label>';
+ $s .= '<label id="tumblr-enable-label" for="tumblr-checkbox">' . t('Enable Tumblr Post Addon') . '</label>';
$s .= '<input id="tumblr-checkbox" type="checkbox" name="tumblr" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/* Twitter Plugin for Friendica
+/* Twitter Addon for Friendica
*
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
* 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 at https://twitter.com/apps
*
* Register your Friendica site as "Client" application with "Read & Write" access
* $a->config['twitter']['consumerkey'] = 'your consumer_key here';
* $a->config['twitter']['consumersecret'] = 'your consumer_secret here';
*
- * To activate the plugin itself add it to the $a->config['system']['addon']
+ * To activate the addon itself add it to the $a->config['system']['addon']
* setting. After this, your user can configure their Twitter account settings
- * from "Settings -> Plugin Settings".
+ * from "Settings -> Addon Settings".
*
* Requirements: PHP5, curl [Slinky library]
*/
// old setting - remove only
Addon::unregisterHook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook');
- Addon::unregisterHook('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/twitter/twitter.php', 'twitter_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
}
function twitter_check_item_notification(App $a, &$notification_data)
/* * *
* make some nice form
*/
- $s .= '<p>' . t('At this Friendica instance the Twitter plugin was enabled but you have not yet connected your account to your Twitter account. To do so click the button below to get a PIN from Twitter which you have to copy into the input box below and submit the form. Only your <strong>public</strong> posts will be posted to Twitter.') . '</p>';
+ $s .= '<p>' . t('At this Friendica instance the Twitter addon was enabled but you have not yet connected your account to your Twitter account. To do so click the button below to get a PIN from Twitter which you have to copy into the input box below and submit the form. Only your <strong>public</strong> posts will be posted to Twitter.') . '</p>';
$s .= '<a href="' . $connection->getAuthorizeURL($token) . '" target="_twitter"><img src="addon/twitter/lighter.png" alt="' . t('Log in with Twitter') . '"></a>';
$s .= '<div id="twitter-pin-wrapper">';
$s .= '<label id="twitter-pin-label" for="twitter-pin">' . t('Copy the PIN from Twitter here') . '</label>';
}
}
-function twitter_plugin_admin_post(App $a)
+function twitter_addon_admin_post(App $a)
{
$consumerkey = x($_POST, 'consumerkey') ? notags(trim($_POST['consumerkey'])) : '';
$consumersecret = x($_POST, 'consumersecret') ? notags(trim($_POST['consumersecret'])) : '';
info(t('Settings updated.') . EOL);
}
-function twitter_plugin_admin(App $a, &$o)
+function twitter_addon_admin(App $a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/twitter/");
$b['app_menu'][] = '<div class="app-title"><a href="webrtc">' . t('WebRTC Videochat') . '</a></div>';
}
-function webrtc_plugin_admin (&$a, &$o) {
+function webrtc_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/webrtc/" );
$o = replace_macros( $t, [
'$submit' => t('Save Settings'),
'$webrtcurl' => ['webrtcurl', t('WebRTC Base URL'), Config::get('webrtc','webrtcurl' ), t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .')],
]);
}
-function webrtc_plugin_admin_post (&$a) {
+function webrtc_addon_admin_post (&$a) {
$url = ((x($_POST, 'webrtcurl')) ? notags(trim($_POST['webrtcurl'])) : '');
Config::set('webrtc', 'webrtcurl', $url);
info( t('Settings updated.'). EOL);
use Friendica\Core\PConfig;
function widgets_install() {
- Addon::registerHook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings');
- Addon::registerHook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
+ Addon::registerHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings');
+ Addon::registerHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
logger("installed widgets");
}
function widgets_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
}
if (isset($_GET['p']) && local_user()==$conf['uid'] ) {
$o .= "<style>.f9k_widget { float: left;border:1px solid black; }</style>";
$o .= "<h1>Preview Widget</h1>";
- $o .= '<a href="'.$a->get_baseurl().'/settings/addon">'. t("Plugin Settings") .'</a>';
+ $o .= '<a href="'.$a->get_baseurl().'/settings/addon">'. t("Addon Settings") .'</a>';
$o .= "<h4>".call_user_func($a->argv[1].'_widget_name')."</h4>";
$o .= call_user_func($a->argv[1].'_widget_help');
* Pre-requisite: Windows Phone mobile device (at least WP 7.0)
* Friendica mobile app on Windows Phone
*
- * When plugin is installed, the system calls the plugin
+ * When addon is installed, the system calls the addon
* name_install() function, located in 'addon/name/name.php',
* where 'name' is the name of the addon.
* If the addon is removed from the configuration list, the
function windowsphonepush_install()
{
- /* Our plugin will attach in three places.
+ /* Our addon will attach in three places.
* The first is within cron - so the push notifications will be
* sent every 10 minutes (or whatever is set in crontab).
*/
Addon::registerHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
- /* Then we'll attach into the plugin settings page, and also the
+ /* Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
- * user preferences. User shall be able to activate the plugin and
+ * user preferences. User shall be able to activate the addon and
* define whether he allows pushing first characters of item text
*/
- Addon::registerHook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
- Addon::registerHook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
+ Addon::registerHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
+ Addon::registerHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
logger("installed windowsphonepush");
}
* during install. Don't delete data in table `pconfig`.
*/
Addon::unregisterHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
- Addon::unregisterHook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
logger("removed windowsphonepush");
}
info(t('WindowsPhonePush settings updated.') . EOL);
}
-/* Called from the Plugin Setting form.
+/* Called from the Addon Setting form.
* Add our own settings info to the page.
*/
function windowsphonepush_settings(&$a, &$s)
$s .= '<h3>' . t('WindowsPhonePush Settings') . '</h3>';
$s .= '<div id="windowsphonepush-enable-wrapper">';
- $s .= '<label id="windowsphonepush-enable-label" for="windowsphonepush-enable-chk">' . t('Enable WindowsPhonePush Plugin') . '</label>';
+ $s .= '<label id="windowsphonepush-enable-label" for="windowsphonepush-enable-chk">' . t('Enable WindowsPhonePush Addon') . '</label>';
$s .= '<input id="windowsphonepush-enable-chk" type="checkbox" name="windowsphonepush" value="1" ' . $checked_enabled . '/>';
$s .= '</div><div class="clear"></div>';
return;
}
-/* Cron function used to regularly check all users on the server with active windowsphonepushplugin and send
+/* Cron function used to regularly check all users on the server with active windowsphonepushaddon and send
* notifications to the Microsoft servers and consequently to the Windows Phone device
*/
function windowsphonepush_cron()
{
- // retrieve all UID's for which the plugin windowsphonepush is enabled and loop through every user
+ // retrieve all UID's for which the addon windowsphonepush is enabled and loop through every user
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'windowsphonepush' AND `k` = 'enable' AND `v` = 1");
if (count($r)) {
foreach ($r as $rr) {
// pushing only possible if device_url (the URI on Microsoft server) is available or not "NA" (which will be sent
// by app if user has switched the server setting in app - sending blank not possible as this would return an update error)
if (( $device_url == "" ) || ( $device_url == "NA" )) {
- // no Device-URL for the user availabe, but plugin is enabled --> write info to Logger
+ // no Device-URL for the user availabe, but addon is enabled --> write info to Logger
logger("WARN: windowsphonepush is enable for user " . $rr['uid'] . ", but no Device-URL is specified for the user.");
} else {
// retrieve the number of unseen items and the id of the latest one (if there are more than
return "Not Authenticated";
}
- // no updating if user hasn't enabled the plugin
+ // no updating if user hasn't enabled the addon
$enable = PConfig::get(local_user(), 'windowsphonepush', 'enable');
if (!$enable) {
return "Plug-in not enabled";
return "Not Authenticated";
}
- // no updating if user hasn't enabled the plugin
+ // no updating if user hasn't enabled the addon
$enable = PConfig::get(local_user(), 'windowsphonepush', 'enable');
if (!$enable) {
return "Plug-in not enabled";
// obsolete - remove
Addon::unregisterHook('post_local_end', 'addon/wppost/wppost.php', 'wppost_send');
- Addon::unregisterHook('plugin_settings', 'addon/wppost/wppost.php', 'wppost_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/wppost/wppost.php', 'wppost_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post');
}
$s .= '<img class="connector'.$css.'" src="images/wordpress.png" /><h3 class="connector">'. t('Wordpress Export').'</h3>';
$s .= '</span>';
$s .= '<div id="wppost-enable-wrapper">';
- $s .= '<label id="wppost-enable-label" for="wppost-checkbox">' . t('Enable WordPress Post Plugin') . '</label>';
+ $s .= '<label id="wppost-enable-label" for="wppost-checkbox">' . t('Enable WordPress Post Addon') . '</label>';
$s .= '<input id="wppost-checkbox" type="checkbox" name="wppost" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
function xmpp_install()
{
- Addon::registerHook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings');
- Addon::registerHook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post');
+ Addon::registerHook('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post');
Addon::registerHook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
Addon::registerHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
}
function xmpp_uninstall()
{
- Addon::unregisterHook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post');
Addon::unregisterHook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
Addon::unregisterHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
}
-function xmpp_plugin_settings_post()
+function xmpp_addon_settings_post()
{
if (!local_user() || (!x($_POST, 'xmpp-settings-submit'))) {
return;
info(t('XMPP settings updated.') . EOL);
}
-function xmpp_plugin_settings(App $a, &$s)
+function xmpp_addon_settings(App $a, &$s)
{
if (!local_user()) {
return;
}
}
-function xmpp_plugin_admin(App $a, &$o)
+function xmpp_addon_admin(App $a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/xmpp/");
]);
}
-function xmpp_plugin_admin_post()
+function xmpp_addon_admin_post()
{
$bosh_proxy = ((x($_POST, 'bosh_proxy')) ? trim($_POST['bosh_proxy']) : '');
$central_userbase = ((x($_POST, 'central_userbase')) ? intval($_POST['central_userbase']) : false);
/**
* Name: Yourls
- * Description: Defines a YourLS url shortener for the Statusnet & Twitter plugins
+ * Description: Defines a YourLS url shortener for the Statusnet & Twitter addons
* Version: 1.0
* Author: Keith Fernie <http://friendika.me4.it/profile/keith>
*
use Friendica\Core\Config;
function yourls_install() {
- Addon::registerHook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
- Addon::registerHook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
+ Addon::registerHook('addon_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
+ Addon::registerHook('addon_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
}
function yourls_uninstall() {
- Addon::unregisterHook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
- Addon::unregisterHook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
+ Addon::unregisterHook('addon_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
+ Addon::unregisterHook('addon_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
Config::set('yourls','url1',trim($_POST['']));
Config::set('yourls','username1',trim($_POST['']));
Config::set('yourls','password1',trim($_POST['']));