forked from friendica/friendica-addons
		
	Update function names
update function names and hook calls
This commit is contained in:
		
					parent
					
						
							
								0afd633346
							
						
					
				
			
			
				commit
				
					
						c71f7b0e1a
					
				
			
		
					 50 changed files with 356 additions and 348 deletions
				
			
		|  | @ -9,12 +9,12 @@ | ||||||
|  * About |  * 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 |  * all your ~friendica visitors from the web will be redirected to a page | ||||||
|  * you can configure in the admin panel as well. |  * you can configure in the admin panel as well. | ||||||
|  * |  * | ||||||
|  * Calls to the API and the communication with other ~friendica nodes is |  * 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 |  * 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 |  * currently logged in users will be effected as well. But if they log | ||||||
|  | @ -88,7 +88,7 @@ function blackout_redirect ($a, $b) { | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function blackout_plugin_admin(&$a, &$o) { | function blackout_addon_admin(&$a, &$o) { | ||||||
|     $mystart = Config::get('blackout','begindate'); |     $mystart = Config::get('blackout','begindate'); | ||||||
|     if (! is_string($mystart)) { $mystart = "YYYY-MM-DD:hhmm"; } |     if (! is_string($mystart)) { $mystart = "YYYY-MM-DD:hhmm"; } | ||||||
|     $myend   = Config::get('blackout','enddate'); |     $myend   = Config::get('blackout','enddate'); | ||||||
|  | @ -112,7 +112,7 @@ function blackout_plugin_admin(&$a, &$o) { | ||||||
|         $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; |         $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']); |     $begindate = trim($_POST['startdate']); | ||||||
|     $enddate = trim($_POST['enddate']); |     $enddate = trim($_POST['enddate']); | ||||||
|     $url = trim($_POST['rurl']); |     $url = trim($_POST['rurl']); | ||||||
|  |  | ||||||
|  | @ -12,30 +12,25 @@ use Friendica\Core\PConfig; | ||||||
| function blockem_install() { | function blockem_install() { | ||||||
| 	Addon::registerHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body'); | 	Addon::registerHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body'); | ||||||
| 	Addon::registerHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item'); | 	Addon::registerHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item'); | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); | ||||||
| 	Addon::registerHook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start'); | 	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('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() { | function blockem_uninstall() { | ||||||
| 	Addon::unregisterHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body'); | 	Addon::unregisterHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body'); | ||||||
| 	Addon::unregisterHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item'); | 	Addon::unregisterHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); | ||||||
| 	Addon::unregisterHook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start'); | 	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('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()) | 	if(! local_user()) | ||||||
| 		return; | 		return; | ||||||
|  | @ -45,7 +40,7 @@ function blockem_addon_settings(&$a,&$s) { | ||||||
|     $a->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . $a->get_baseurl() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n"; |     $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) | 	if(! $words) | ||||||
| 		$words = ''; | 		$words = ''; | ||||||
| 
 | 
 | ||||||
|  | @ -79,7 +74,6 @@ function blockem_addon_settings_post(&$a,&$b) { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| function blockem_enotify_store(&$a,&$b) { | function blockem_enotify_store(&$a,&$b) { | ||||||
| 
 | 
 | ||||||
| 	$words = PConfig::get($b['uid'],'blockem','words'); | 	$words = PConfig::get($b['uid'],'blockem','words'); | ||||||
|  | @ -143,13 +137,11 @@ function blockem_prepare_body(&$a,&$b) { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| function blockem_display_item(&$a,&$b) { | function blockem_display_item(&$a,&$b) { | ||||||
| 	if(strstr($b['output']['body'],'id="blockem-wrap-')) | 	if(strstr($b['output']['body'],'id="blockem-wrap-')) | ||||||
| 		$b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg"; | 		$b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg"; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| function blockem_conversation_start(&$a,&$b) { | function blockem_conversation_start(&$a,&$b) { | ||||||
| 
 | 
 | ||||||
| 	if(! local_user()) | 	if(! local_user()) | ||||||
|  |  | ||||||
|  | @ -8,7 +8,8 @@ | ||||||
| use Friendica\Core\Addon; | use Friendica\Core\Addon; | ||||||
| use Friendica\Core\PConfig; | use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function blogger_install() { | function blogger_install() | ||||||
|  | { | ||||||
| 	Addon::registerHook('post_local',           'addon/blogger/blogger.php', 'blogger_post_local'); | 	Addon::registerHook('post_local',           'addon/blogger/blogger.php', 'blogger_post_local'); | ||||||
| 	Addon::registerHook('notifier_normal',      'addon/blogger/blogger.php', 'blogger_send'); | 	Addon::registerHook('notifier_normal',      'addon/blogger/blogger.php', 'blogger_send'); | ||||||
| 	Addon::registerHook('jot_networks',         'addon/blogger/blogger.php', 'blogger_jot_nets'); | 	Addon::registerHook('jot_networks',         'addon/blogger/blogger.php', 'blogger_jot_nets'); | ||||||
|  | @ -16,7 +17,8 @@ function blogger_install() { | ||||||
| 	Addon::registerHook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); | 	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('post_local',       'addon/blogger/blogger.php', 'blogger_post_local'); | ||||||
| 	Addon::unregisterHook('notifier_normal',  'addon/blogger/blogger.php', 'blogger_send'); | 	Addon::unregisterHook('notifier_normal',  'addon/blogger/blogger.php', 'blogger_send'); | ||||||
| 	Addon::unregisterHook('jot_networks',     'addon/blogger/blogger.php', 'blogger_jot_nets'); | 	Addon::unregisterHook('jot_networks',     'addon/blogger/blogger.php', 'blogger_jot_nets'); | ||||||
|  | @ -25,28 +27,29 @@ function blogger_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	// obsolete - remove
 | 	// obsolete - remove
 | ||||||
| 	Addon::unregisterHook('post_local_end',   'addon/blogger/blogger.php', 'blogger_send'); | 	Addon::unregisterHook('post_local_end',   'addon/blogger/blogger.php', 'blogger_send'); | ||||||
| 	Addon::unregisterHook('plugin_settings',  'addon/blogger/blogger.php', 'blogger_settings'); | 	Addon::unregisterHook('addon_settings',  'addon/blogger/blogger.php', 'blogger_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post',  'addon/blogger/blogger.php', 'blogger_settings_post'); | 	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()) { | 	if (!local_user()) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	$bl_post = PConfig::get(local_user(),'blogger','post'); | 	$bl_post = PConfig::get(local_user(), 'blogger', 'post'); | ||||||
| 	if (intval($bl_post) == 1) { | 	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" ' : ''); | 		$selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : ''); | ||||||
| 		$b .= '<div class="profile-jot-net"><input type="checkbox" name="blogger_enable" ' . $selected . ' value="1" /> ' | 		$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()) { | 	if (! local_user()) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  | @ -57,11 +60,11 @@ function blogger_settings(&$a,&$s) { | ||||||
| 
 | 
 | ||||||
| 	/* Get the current state of our config variables */ | 	/* 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" ' : ''); | 	$checked = (($enabled) ? ' checked="checked" ' : ''); | ||||||
| 	$css = (($enabled) ? '' : '-disabled'); | 	$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" ' : ''); | 	$def_checked = (($def_enabled) ? ' checked="checked" ' : ''); | ||||||
| 
 | 
 | ||||||
|  | @ -79,7 +82,7 @@ function blogger_settings(&$a,&$s) { | ||||||
| 	$s .= '</span>'; | 	$s .= '</span>'; | ||||||
| 
 | 
 | ||||||
| 	$s .= '<div id="blogger-enable-wrapper">'; | 	$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 .= '<input id="blogger-checkbox" type="checkbox" name="blogger" value="1" ' . $checked . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  | @ -108,17 +111,19 @@ function blogger_settings(&$a,&$s) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function blogger_settings_post(&$a,&$b) { | function blogger_settings_post(&$a, &$b) | ||||||
| 	if (x($_POST,'blogger-submit')) { | { | ||||||
| 		PConfig::set(local_user(),'blogger','post',intval($_POST['blogger'])); | 	if (x($_POST, 'blogger-submit')) { | ||||||
| 		PConfig::set(local_user(),'blogger','post_by_default',intval($_POST['bl_bydefault'])); | 		PConfig::set(local_user(), 'blogger', 'post', intval($_POST['blogger'])); | ||||||
| 		PConfig::set(local_user(),'blogger','bl_username',trim($_POST['bl_username'])); | 		PConfig::set(local_user(), 'blogger', 'post_by_default', intval($_POST['bl_bydefault'])); | ||||||
| 		PConfig::set(local_user(),'blogger','bl_password',trim($_POST['bl_password'])); | 		PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username'])); | ||||||
| 		PConfig::set(local_user(),'blogger','bl_blog',trim($_POST['bl_blog'])); | 		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
 | 	// This can probably be changed to allow editing by pointing to a different API endpoint
 | ||||||
| 
 | 
 | ||||||
| 	if ($b['edit']) { | 	if ($b['edit']) { | ||||||
|  | @ -133,11 +138,11 @@ function blogger_post_local(&$a,&$b) { | ||||||
| 		return; | 		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; | 		$bl_enable = 1; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -155,12 +160,13 @@ function blogger_post_local(&$a,&$b) { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function blogger_send(&$a,&$b) { | function blogger_send(&$a, &$b) | ||||||
|  | { | ||||||
| 	if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { | 	if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (! strstr($b['postopts'],'blogger')) { | 	if (! strstr($b['postopts'], 'blogger')) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -168,12 +174,11 @@ function blogger_send(&$a,&$b) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	$bl_username = xmlify(PConfig::get($b['uid'],'blogger','bl_username')); | 	$bl_username = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); | ||||||
| 	$bl_password = xmlify(PConfig::get($b['uid'],'blogger','bl_password')); | 	$bl_password = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password')); | ||||||
| 	$bl_blog = PConfig::get($b['uid'],'blogger','bl_blog'); | 	$bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); | ||||||
| 
 | 
 | ||||||
| 	if ($bl_username && $bl_password && $bl_blog) { | 	if ($bl_username && $bl_password && $bl_blog) { | ||||||
| 
 |  | ||||||
| 		require_once('include/bbcode.php'); | 		require_once('include/bbcode.php'); | ||||||
| 
 | 
 | ||||||
| 		$title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>'; | 		$title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>'; | ||||||
|  | @ -199,7 +204,7 @@ EOT; | ||||||
| 		logger('blogger: data: ' . $xml, LOGGER_DATA); | 		logger('blogger: data: ' . $xml, LOGGER_DATA); | ||||||
| 
 | 
 | ||||||
| 		if ($bl_blog !== 'test') { | 		if ($bl_blog !== 'test') { | ||||||
| 			$x = post_url($bl_blog,$xml); | 			$x = post_url($bl_blog, $xml); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG); | 		logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG); | ||||||
|  |  | ||||||
|  | @ -55,22 +55,24 @@ function buffer_content(&$a) { | ||||||
| 	return $o; | 	return $o; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function buffer_plugin_admin(&$a, &$o){ | function buffer_addon_admin(&$a, &$o) | ||||||
| 	$t = get_markup_template( "admin.tpl", "addon/buffer/" ); | { | ||||||
|  | 	$t = get_markup_template("admin.tpl", "addon/buffer/"); | ||||||
| 
 | 
 | ||||||
| 	$o = replace_macros($t, [ | 	$o = replace_macros($t, [ | ||||||
| 		'$submit' => t('Save Settings'), | 		'$submit' => t('Save Settings'), | ||||||
| 								// name, label, value, help, [extra values]
 | 		// name, label, value, help, [extra values]
 | ||||||
| 		'$client_id' => ['client_id', t('Client ID'),  Config::get('buffer', 'client_id' ), ''], | 		'$client_id' => ['client_id', t('Client ID'), Config::get('buffer', 'client_id'), ''], | ||||||
| 		'$client_secret' => ['client_secret', t('Client Secret'),  Config::get('buffer', 'client_secret' ), ''], | 		'$client_secret' => ['client_secret', t('Client Secret'), Config::get('buffer', 'client_secret'), ''], | ||||||
| 	]); | 	]); | ||||||
| } | } | ||||||
| function buffer_plugin_admin_post(&$a){ | 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'])): ''); | 	$client_id     =       ((x($_POST, 'client_id'))              ? notags(trim($_POST['client_id']))   : ''); | ||||||
|         Config::set('buffer','client_id',$client_id); | 	$client_secret =       ((x($_POST, 'client_secret'))   ? notags(trim($_POST['client_secret'])): ''); | ||||||
|         Config::set('buffer','client_secret',$client_secret); | 	Config::set('buffer', 'client_id', $client_id); | ||||||
|         info( t('Settings updated.'). EOL ); | 	Config::set('buffer', 'client_secret', $client_secret); | ||||||
|  | 	info(t('Settings updated.'). EOL); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function buffer_connect(&$a) { | function buffer_connect(&$a) { | ||||||
|  | @ -155,7 +157,7 @@ function buffer_settings(&$a,&$s) { | ||||||
| 		$s .= '</div><div class="clear"></div>'; | 		$s .= '</div><div class="clear"></div>'; | ||||||
| 	} else { | 	} else { | ||||||
| 		$s .= '<div id="buffer-enable-wrapper">'; | 		$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 .= '<input id="buffer-checkbox" type="checkbox" name="buffer" value="1" ' . $checked . '/>'; | ||||||
| 		$s .= '</div><div class="clear"></div>'; | 		$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -33,25 +33,28 @@ function communityhome_getopts() { | ||||||
| 	]; | 	]; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function communityhome_plugin_admin(&$a, &$o) { | function communityhome_addon_admin(&$a, &$o) | ||||||
| 	$tpl = get_markup_template( 'settings.tpl', 'addon/communityhome/' ); | { | ||||||
|  | 	$tpl = get_markup_template('settings.tpl', 'addon/communityhome/'); | ||||||
| 
 | 
 | ||||||
| 	$opts = communityhome_getopts(); | 	$opts = communityhome_getopts(); | ||||||
| 	$ctx = [ | 	$ctx = [ | ||||||
| 		'$submit' => t("Submit"), | 		'$submit' => t("Submit"), | ||||||
| 		'$fields' => [], | 		'$fields' => [], | ||||||
| 	]; | 	]; | ||||||
| 	foreach($opts as $k=>$v) { | 
 | ||||||
|  | 	foreach ($opts as $k => $v) { | ||||||
| 		$ctx['fields'][] = ['communityhome_'.$k, $v, Config::get('communityhome', $k)]; | 		$ctx['fields'][] = ['communityhome_'.$k, $v, Config::get('communityhome', $k)]; | ||||||
| 	} | 	} | ||||||
| 	$o = replace_macros($tpl, $ctx); | 	$o = replace_macros($tpl, $ctx); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function communityhome_plugin_admin_post(&$a,&$b) { | function communityhome_addon_admin_post(&$a, &$b) | ||||||
| 	if(x($_POST,'communityhome-submit')) { | { | ||||||
|  | 	if (x($_POST, 'communityhome-submit')) { | ||||||
| 		$opts = communityhome_getopts(); | 		$opts = communityhome_getopts(); | ||||||
| 		foreach($opts as $k=>$v) { | 		foreach ($opts as $k => $v) { | ||||||
| 			Config::set('communityhome', $k, x($_POST,'communityhome_'.$k)); | 			Config::set('communityhome', $k, x($_POST, 'communityhome_'.$k)); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -66,16 +66,17 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0) | ||||||
|     return $r; |     return $r; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function curweather_install() { | function curweather_install() | ||||||
|  | { | ||||||
| 	Addon::registerHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init'); | 	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('addon_settings', 'addon/curweather/curweather.php', 'curweather_addon_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function curweather_uninstall() { | function curweather_uninstall() { | ||||||
| 	Addon::unregisterHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init'); | 	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('addon_settings', 'addon/curweather/curweather.php', 'curweather_addon_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function curweather_network_mod_init(&$fk_app,&$b) { | function curweather_network_mod_init(&$fk_app,&$b) { | ||||||
|  | @ -141,7 +142,7 @@ 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'))) | 	if(! local_user() || (! x($_POST,'curweather-settings-submit'))) | ||||||
| 		return; | 		return; | ||||||
| 	PConfig::set(local_user(),'curweather','curweather_loc',trim($_POST['curweather_loc'])); | 	PConfig::set(local_user(),'curweather','curweather_loc',trim($_POST['curweather_loc'])); | ||||||
|  | @ -152,7 +153,7 @@ function curweather_plugin_settings_post($a,$post) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function curweather_plugin_settings(&$a,&$s) { | function curweather_addon_settings(&$a,&$s) { | ||||||
| 
 | 
 | ||||||
| 	if(! local_user()) | 	if(! local_user()) | ||||||
| 		return; | 		return; | ||||||
|  | @ -186,7 +187,7 @@ function curweather_plugin_settings(&$a,&$s) { | ||||||
| } | } | ||||||
| // Config stuff for the admin panel to let the admin of the node set a APPID
 | // Config stuff for the admin panel to let the admin of the node set a APPID
 | ||||||
| // for accessing the API of openweathermap
 | // for accessing the API of openweathermap
 | ||||||
| function curweather_plugin_admin_post (&$a) { | function curweather_addon_admin_post (&$a) { | ||||||
| 	if(! is_site_admin()) | 	if(! is_site_admin()) | ||||||
| 	    return; | 	    return; | ||||||
| 	if ($_POST['curweather-submit']) { | 	if ($_POST['curweather-submit']) { | ||||||
|  | @ -195,7 +196,7 @@ function curweather_plugin_admin_post (&$a) { | ||||||
| 	    info( t('Curweather settings saved.'.EOL)); | 	    info( t('Curweather settings saved.'.EOL)); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| function curweather_plugin_admin (&$a, &$o) { | function curweather_addon_admin (&$a, &$o) { | ||||||
|     if(! is_site_admin()) |     if(! is_site_admin()) | ||||||
| 	    return; | 	    return; | ||||||
|     $appid = Config::get('curweather','appid'); |     $appid = Config::get('curweather','appid'); | ||||||
|  |  | ||||||
|  | @ -203,7 +203,7 @@ function dav_content() | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} catch (DAVVersionMismatchException $e) { | 	} 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; | 	return $x; | ||||||
| } | } | ||||||
|  | @ -302,9 +302,9 @@ function dav_cron(&$a, &$b) | ||||||
|  * @param App $a |  * @param App $a | ||||||
|  * @param null|object $o |  * @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(); | 	dav_include_files(); | ||||||
| 	require_once(__DIR__ . "/database-init.inc.php"); | 	require_once(__DIR__ . "/database-init.inc.php"); | ||||||
|  | @ -327,7 +327,7 @@ function dav_plugin_admin_post(&$a = null, &$o = null) | ||||||
|  * @param App $a |  * @param App $a | ||||||
|  * @param string $o |  * @param string $o | ||||||
|  */ |  */ | ||||||
| function dav_plugin_admin(&$a, &$o) | function dav_addon_admin(&$a, &$o) | ||||||
| { | { | ||||||
| 	dav_include_files(); | 	dav_include_files(); | ||||||
| 	require_once(__DIR__ . "/database-init.inc.php"); | 	require_once(__DIR__ . "/database-init.inc.php"); | ||||||
|  |  | ||||||
|  | @ -12,8 +12,8 @@ use Friendica\Core\PConfig; | ||||||
| function fromapp_install() { | function fromapp_install() { | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); | 	Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); | 	Addon::registerHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed fromapp"); | 	logger("installed fromapp"); | ||||||
| } | } | ||||||
|  | @ -22,8 +22,8 @@ function fromapp_install() { | ||||||
| function fromapp_uninstall() { | function fromapp_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); | 	Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed fromapp"); | 	logger("removed fromapp"); | ||||||
|  |  | ||||||
|  | @ -30,8 +30,8 @@ function fromgplus_uninstall() { | ||||||
| 	Addon::unregisterHook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron'); | 	Addon::unregisterHook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron'); | ||||||
| 
 | 
 | ||||||
| 	// Old hooks
 | 	// Old hooks
 | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function fromgplus_addon_settings(&$a,&$s) { | function fromgplus_addon_settings(&$a,&$s) { | ||||||
|  | @ -94,19 +94,21 @@ function fromgplus_addon_settings_post(&$a,&$b) { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function fromgplus_plugin_admin(&$a, &$o){ | function fromgplus_addon_admin(&$a, &$o) | ||||||
|         $t = get_markup_template("admin.tpl", "addon/fromgplus/"); | { | ||||||
|  | 	$t = get_markup_template("admin.tpl", "addon/fromgplus/"); | ||||||
| 
 | 
 | ||||||
|         $o = replace_macros($t, [ | 	$o = replace_macros($t, [ | ||||||
|                 '$submit' => t('Save Settings'), | 			'$submit' => t('Save Settings'), | ||||||
|                 '$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')], | 			'$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')], | ||||||
|         ]); | 	]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function fromgplus_plugin_admin_post(&$a){ | function fromgplus_addon_admin_post(&$a) | ||||||
|         $key = ((x($_POST,'key')) ? trim($_POST['key']) : ''); | { | ||||||
|         Config::set('fromgplus','key',$key); | 	$key = ((x($_POST, 'key')) ? trim($_POST['key']) : ''); | ||||||
|         info( t('Settings updated.'). EOL ); | 	Config::set('fromgplus', 'key', $key); | ||||||
|  | 	info(t('Settings updated.'). EOL); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function fromgplus_cron($a,$b) { | function fromgplus_cron($a,$b) { | ||||||
|  |  | ||||||
|  | @ -81,24 +81,24 @@ function geocoordinates_post_hook($a, &$item) | ||||||
| 	geocoordinates_resolve_item($item); | 	geocoordinates_resolve_item($item); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function geocoordinates_plugin_admin(&$a, &$o) | function geocoordinates_addon_admin(&$a, &$o) | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
| 	$t = get_markup_template("admin.tpl", "addon/geocoordinates/"); | 	$t = get_markup_template("admin.tpl", "addon/geocoordinates/"); | ||||||
| 
 | 
 | ||||||
| 	$o = replace_macros($t, [ | 	$o = replace_macros($t, [ | ||||||
| 		'$submit' => t('Save Settings'), | 		'$submit' => t('Save Settings'), | ||||||
| 		'$api_key' => ['api_key', t('API Key'),  Config::get('geocoordinates', 'api_key' ), ''], | 		'$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key'), ''], | ||||||
| 		'$language' => ['language', t('Language code (IETF format)'),  Config::get('geocoordinates', 'language' ), ''], | 		'$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']))   : ''); | 	$api_key  = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key']))   : ''); | ||||||
| 	Config::set('geocoordinates','api_key',$api_key); | 	Config::set('geocoordinates', 'api_key', $api_key); | ||||||
| 
 | 
 | ||||||
| 	$language  = ((x($_POST,'language')) ? notags(trim($_POST['language']))   : ''); | 	$language  = ((x($_POST, 'language')) ? notags(trim($_POST['language']))   : ''); | ||||||
| 	Config::set('geocoordinates','language',$language); | 	Config::set('geocoordinates', 'language', $language); | ||||||
| 	info(t('Settings updated.'). EOL); | 	info(t('Settings updated.'). EOL); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -12,7 +12,7 @@ | ||||||
|  * $a->config['geonames']['username'] = 'your_username'; |  * $a->config['geonames']['username'] = 'your_username'; | ||||||
|  * Also visit http://geonames.org/manageaccount and enable access to the free web services |  * 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', |  * name_install() function, located in 'addon/name/name.php', | ||||||
|  * where 'name' is the name of the addon. |  * where 'name' is the name of the addon. | ||||||
|  * If the addon is removed from the configuration list, the  |  * If the addon is removed from the configuration list, the  | ||||||
|  | @ -27,7 +27,7 @@ function geonames_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 *  | 	 *  | ||||||
| 	 * Our plugin will attach in three places. | 	 * Our addon will attach in three places. | ||||||
| 	 * The first is just prior to storing a local post. | 	 * The first is just prior to storing a local post. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
|  | @ -36,14 +36,14 @@ function geonames_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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 | 	 * settings post hook so that we can create and update | ||||||
| 	 * user preferences. | 	 * user preferences. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin'); | 	Addon::registerHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post'); | 	Addon::registerHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed geonames"); | 	logger("installed geonames"); | ||||||
| } | } | ||||||
|  | @ -60,8 +60,8 @@ function geonames_uninstall() { | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('post_local',    'addon/geonames/geonames.php', 'geonames_post_hook'); | 	Addon::unregisterHook('post_local',    'addon/geonames/geonames.php', 'geonames_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin'); | 	Addon::unregisterHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed geonames"); | 	logger("removed geonames"); | ||||||
|  | @ -76,7 +76,7 @@ function geonames_post_hook($a, &$item) { | ||||||
| 	 * An item was posted on the local system. | 	 * An item was posted on the local system. | ||||||
| 	 * We are going to look for specific items: | 	 * We are going to look for specific items: | ||||||
| 	 *      - A status post by a profile owner | 	 *      - A status post by a profile owner | ||||||
| 	 *      - The profile owner must have allowed our plugin | 	 *      - The profile owner must have allowed our addon | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
|  | @ -137,7 +137,7 @@ function geonames_post_hook($a, &$item) { | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| function geonames_plugin_admin_post($a,$post) { | function geonames_addon_admin_post($a,$post) { | ||||||
| 	if(! local_user() || (! x($_POST,'geonames-submit'))) | 	if(! local_user() || (! x($_POST,'geonames-submit'))) | ||||||
| 		return; | 		return; | ||||||
| 	PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames'])); | 	PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames'])); | ||||||
|  | @ -148,14 +148,14 @@ function geonames_plugin_admin_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form.  |  * Called from the Addon Setting form.  | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function geonames_plugin_admin(&$a,&$s) { | function geonames_addon_admin(&$a,&$s) { | ||||||
| 
 | 
 | ||||||
| 	if(! local_user()) | 	if(! local_user()) | ||||||
| 		return; | 		return; | ||||||
|  | @ -180,7 +180,7 @@ function geonames_plugin_admin(&$a,&$s) { | ||||||
| 	$s .= '<div class="settings-block">'; | 	$s .= '<div class="settings-block">'; | ||||||
| 	$s .= '<h3>' . t('Geonames Settings') . '</h3>'; | 	$s .= '<h3>' . t('Geonames Settings') . '</h3>'; | ||||||
| 	$s .= '<div id="geonames-enable-wrapper">'; | 	$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 .= '<input id="geonames-checkbox" type="checkbox" name="geonames" value="1" ' . $checked . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,8 +12,8 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function gnot_install() { | function gnot_install() { | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings'); | 	Addon::registerHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); | ||||||
| 	Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); | 	Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed gnot"); | 	logger("installed gnot"); | ||||||
|  | @ -22,8 +22,8 @@ function gnot_install() { | ||||||
| 
 | 
 | ||||||
| function gnot_uninstall() { | function gnot_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); | ||||||
| 	Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); | 	Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -52,7 +52,7 @@ function gnot_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form.  |  * Called from the Addon Setting form.  | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  | @ -80,7 +80,7 @@ function gnot_settings(&$a,&$s) { | ||||||
| 	$s .= '<h3>' . t('Gnot Settings') . '</h3>'; | 	$s .= '<h3>' . t('Gnot Settings') . '</h3>'; | ||||||
| 	$s .= '<div id="gnot-wrapper">'; | 	$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 .= '<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 .= '<input id="gnot-input" type="checkbox" name="gnot" value="1"'.  $gnot_checked . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: Gravatar Support |  * 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 |  * Version: 1.1 | ||||||
|  * Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus> |  * Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus> | ||||||
|  */ |  */ | ||||||
|  | @ -9,7 +9,7 @@ use Friendica\Core\Addon; | ||||||
| use Friendica\Core\Config; | use Friendica\Core\Config; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Installs the plugin hook |  * Installs the addon hook | ||||||
|  */ |  */ | ||||||
| function gravatar_install() { | function gravatar_install() { | ||||||
| 	Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); | 	Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); | ||||||
|  | @ -18,7 +18,7 @@ function gravatar_install() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Removes the plugin hook |  * Removes the addon hook | ||||||
|  */ |  */ | ||||||
| function gravatar_uninstall() { | function gravatar_uninstall() { | ||||||
| 	Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); | 	Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); | ||||||
|  | @ -56,7 +56,7 @@ function gravatar_lookup($a, &$b) { | ||||||
| /** | /** | ||||||
|  * Display admin settings for this addon |  * 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/" ); | 	$t = get_markup_template( "admin.tpl", "addon/gravatar/" ); | ||||||
| 
 | 
 | ||||||
| 	$default_avatar = Config::get('gravatar', 'default_img'); | 	$default_avatar = Config::get('gravatar', 'default_img'); | ||||||
|  | @ -103,7 +103,7 @@ function gravatar_plugin_admin (&$a, &$o) { | ||||||
| /** | /** | ||||||
|  * Save admin settings |  * Save admin settings | ||||||
|  */ |  */ | ||||||
| function gravatar_plugin_admin_post (&$a) { | function gravatar_addon_admin_post (&$a) { | ||||||
| 	check_form_security_token('gravatarsave'); | 	check_form_security_token('gravatarsave'); | ||||||
| 
 | 
 | ||||||
| 	$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); | 	$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); | ||||||
|  |  | ||||||
|  | @ -10,8 +10,8 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function group_text_install() { | function group_text_install() { | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings'); | 	Addon::registerHook('addon_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_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed group_text"); | 	logger("installed group_text"); | ||||||
| } | } | ||||||
|  | @ -19,8 +19,8 @@ function group_text_install() { | ||||||
| 
 | 
 | ||||||
| function group_text_uninstall() { | function group_text_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed group_text"); | 	logger("removed group_text"); | ||||||
|  | @ -48,7 +48,7 @@ function group_text_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form.  |  * Called from the Addon Setting form.  | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: Impressum |  * 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 |  * Version: 1.3 | ||||||
|  * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias> |  * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias> | ||||||
|  * License: 3-clause BSD license |  * License: 3-clause BSD license | ||||||
|  | @ -16,13 +16,13 @@ use Friendica\Core\Config; | ||||||
| function impressum_install() { | function impressum_install() { | ||||||
|     Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); |     Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); | ||||||
|     Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); |     Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); | ||||||
|     logger("installed impressum plugin"); |     logger("installed impressum Addon"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function impressum_uninstall() { | function impressum_uninstall() { | ||||||
|     Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); |     Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); | ||||||
|     Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); |     Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); | ||||||
|     logger("uninstalled impressum plugin"); |     logger("uninstalled impressum Addon"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function impressum_module() { | function impressum_module() { | ||||||
|  | @ -74,7 +74,7 @@ function impressum_show($a,&$b) { | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function impressum_plugin_admin_post (&$a) { | function impressum_addon_admin_post (&$a) { | ||||||
|     $owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : ''); |     $owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : ''); | ||||||
|     $ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : ''); |     $ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : ''); | ||||||
|     $postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : ''); |     $postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : ''); | ||||||
|  | @ -89,7 +89,7 @@ function impressum_plugin_admin_post (&$a) { | ||||||
|     Config::set('impressum','footer_text',strip_tags($footer_text)); |     Config::set('impressum','footer_text',strip_tags($footer_text)); | ||||||
|     info( t('Settings updated.'). EOL ); |     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/" ); |     $t = get_markup_template( "admin.tpl", "addon/impressum/" ); | ||||||
|     $o = replace_macros($t, [ |     $o = replace_macros($t, [ | ||||||
|         '$submit' => t('Save Settings'), |         '$submit' => t('Save Settings'), | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								irc/irc.php
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								irc/irc.php
									
										
									
									
									
								
							|  | @ -1,6 +1,6 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
| * Name: IRC Chat Plugin | * Name: IRC Chat Addon | ||||||
| * Description: add an Internet Relay Chat chatroom on freenode | * Description: add an Internet Relay Chat chatroom on freenode | ||||||
| * Version: 1.1 | * Version: 1.1 | ||||||
| * Author: tony baldwin <https://free-haven.org/profile/tony> | * Author: tony baldwin <https://free-haven.org/profile/tony> | ||||||
|  | @ -12,13 +12,13 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function irc_install() { | function irc_install() { | ||||||
| 	Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); | 	Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/irc/irc.php', 'irc_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function irc_uninstall() { | function irc_uninstall() { | ||||||
| 	Addon::unregisterHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); | 	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'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -120,7 +120,7 @@ return $o; | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function irc_plugin_admin_post (&$a) { | function irc_addon_admin_post (&$a) { | ||||||
| 	if(! is_site_admin()) | 	if(! is_site_admin()) | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
|  | @ -131,7 +131,7 @@ function irc_plugin_admin_post (&$a) { | ||||||
| 		info( t('IRC settings saved.') . EOL); | 		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 */ | 	$sitechats = Config::get('irc','sitechats'); /* popular channels */ | ||||||
| 	$autochans = Config::get('irc','autochans');  /* auto connect chans */ | 	$autochans = Config::get('irc','autochans');  /* auto connect chans */ | ||||||
| 	$t = get_markup_template( "admin.tpl", "addon/irc/" ); | 	$t = get_markup_template( "admin.tpl", "addon/irc/" ); | ||||||
|  |  | ||||||
|  | @ -70,8 +70,8 @@ use Friendica\Model\User; | ||||||
| 
 | 
 | ||||||
| function jappixmini_install() | function jappixmini_install() | ||||||
| { | { | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); | 	Addon::registerHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); | 	Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); | ||||||
| 	Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); | 	Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); | ||||||
|  | @ -104,8 +104,8 @@ function jappixmini_install() | ||||||
| 
 | 
 | ||||||
| function jappixmini_uninstall() | function jappixmini_uninstall() | ||||||
| { | { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); | 	Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); | ||||||
| 	Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); | 	Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); | ||||||
|  | @ -115,7 +115,7 @@ function jappixmini_uninstall() | ||||||
| 	Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); | 	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
 | 	// display instructions and warnings on addon settings page for admin
 | ||||||
| 	if (!file_exists("addon/jappixmini.tgz")) { | 	if (!file_exists("addon/jappixmini.tgz")) { | ||||||
|  | @ -159,7 +159,7 @@ function jappixmini_plugin_admin(App $a, &$o) | ||||||
| 	$o .= '<input type="submit" name="jappixmini-admin-settings" value="OK" />'; | 	$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
 | 	// set info text
 | ||||||
| 	$submit = $_REQUEST['jappixmini-admin-settings']; | 	$submit = $_REQUEST['jappixmini-admin-settings']; | ||||||
|  | @ -230,7 +230,7 @@ function jappixmini_init() | ||||||
| 
 | 
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// do not return an address if user deactivated plugin
 | 	// do not return an address if user deactivated addon
 | ||||||
| 	$activated = PConfig::get($uid, 'jappixmini', 'activate'); | 	$activated = PConfig::get($uid, 'jappixmini', 'activate'); | ||||||
| 	if (!$activated) { | 	if (!$activated) { | ||||||
| 		killme(); | 		killme(); | ||||||
|  |  | ||||||
|  | @ -16,7 +16,7 @@ function krynn_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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. | 	 * The first is just prior to storing a local post. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
|  | @ -25,14 +25,14 @@ function krynn_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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 | 	 * settings post hook so that we can create and update | ||||||
| 	 * user preferences. | 	 * user preferences. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings'); | 	Addon::registerHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed krynn"); | 	logger("installed krynn"); | ||||||
| } | } | ||||||
|  | @ -49,8 +49,8 @@ function krynn_uninstall() { | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('post_local',    'addon/krynn/krynn.php', 'krynn_post_hook'); | 	Addon::unregisterHook('post_local',    'addon/krynn/krynn.php', 'krynn_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed krynn"); | 	logger("removed krynn"); | ||||||
|  | @ -65,7 +65,7 @@ function krynn_post_hook($a, &$item) { | ||||||
| 	 * An item was posted on the local system. | 	 * An item was posted on the local system. | ||||||
| 	 * We are going to look for specific items: | 	 * We are going to look for specific items: | ||||||
| 	 *      - A status post by a profile owner | 	 *      - A status post by a profile owner | ||||||
| 	 *      - The profile owner must have allowed our plugin | 	 *      - The profile owner must have allowed our addon | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
|  | @ -126,7 +126,7 @@ function krynn_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form. |  * Called from the addon Setting form. | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  | @ -162,7 +162,7 @@ function krynn_settings(&$a,&$s) { | ||||||
|     $s .= '<div class="settings-block">'; |     $s .= '<div class="settings-block">'; | ||||||
| 	$s .= '<h3>' . t('Krynn Settings') . '</h3>'; | 	$s .= '<h3>' . t('Krynn Settings') . '</h3>'; | ||||||
| 	$s .= '<div id="krynn-enable-wrapper">'; | 	$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 .= '<input id="krynn-checkbox" type="checkbox" name="krynn" value="1" ' . $checked . '/>'; | ||||||
|         $s .= '</div><div class="clear"></div></div>'; |         $s .= '</div><div class="clear"></div></div>'; | ||||||
| 	/* provide a submit button */ | 	/* provide a submit button */ | ||||||
|  |  | ||||||
|  | @ -20,15 +20,15 @@ use Friendica\Core\PConfig; | ||||||
| function langfilter_install() | function langfilter_install() | ||||||
| { | { | ||||||
| 	Addon::registerHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body', 10); | 	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('addon_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_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function langfilter_uninstall() | function langfilter_uninstall() | ||||||
| { | { | ||||||
| 	Addon::unregisterHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body'); | 	Addon::unregisterHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* The settings | /* The settings | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: Libravatar Support |  * 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 |  * Version: 1.1 | ||||||
|  * Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus> |  * Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus> | ||||||
|  */ |  */ | ||||||
|  | @ -9,7 +9,7 @@ use Friendica\Core\Addon; | ||||||
| use Friendica\Core\Config; | use Friendica\Core\Config; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Installs the plugin hook |  * Installs the addon hook | ||||||
|  */ |  */ | ||||||
| function libravatar_install() { | function libravatar_install() { | ||||||
| 	if (! version_compare(PHP_VERSION, '5.3.0', '>=')) { | 	if (! version_compare(PHP_VERSION, '5.3.0', '>=')) { | ||||||
|  | @ -23,7 +23,7 @@ function libravatar_install() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Removes the plugin hook |  * Removes the addon hook | ||||||
|  */ |  */ | ||||||
| function libravatar_uninstall() { | function libravatar_uninstall() { | ||||||
| 	Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); | 	Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); | ||||||
|  | @ -61,7 +61,7 @@ function libravatar_lookup($a, &$b) { | ||||||
| /** | /** | ||||||
|  * Display admin settings for this addon |  * 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" ); | 	$t = get_markup_template( "admin.tpl", "addon/libravatar" ); | ||||||
| 
 | 
 | ||||||
| 	$default_avatar = Config::get('libravatar', 'default_img'); | 	$default_avatar = Config::get('libravatar', 'default_img'); | ||||||
|  | @ -106,7 +106,7 @@ function libravatar_plugin_admin (&$a, &$o) { | ||||||
| /** | /** | ||||||
|  * Save admin settings |  * Save admin settings | ||||||
|  */ |  */ | ||||||
| function libravatar_plugin_admin_post (&$a) { | function libravatar_addon_admin_post (&$a) { | ||||||
| 	check_form_security_token('libravatarrsave'); | 	check_form_security_token('libravatarrsave'); | ||||||
| 
 | 
 | ||||||
| 	$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); | 	$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); | ||||||
|  |  | ||||||
|  | @ -11,8 +11,8 @@ use Friendica\Core\PConfig; | ||||||
| use Friendica\Database\DBM; | use Friendica\Database\DBM; | ||||||
| 
 | 
 | ||||||
| function mailstream_install() { | function mailstream_install() { | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings'); | 	Addon::registerHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post'); | 	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_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); | ||||||
| 	Addon::registerHook('post_remote_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'); | 	Addon::registerHook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); | ||||||
|  | @ -52,8 +52,8 @@ function mailstream_install() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function mailstream_uninstall() { | function mailstream_uninstall() { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post'); | 	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_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); | ||||||
| 	Addon::unregisterHook('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_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'); | 	Addon::unregisterHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); | ||||||
|  | @ -66,7 +66,7 @@ function mailstream_uninstall() { | ||||||
| 
 | 
 | ||||||
| function mailstream_module() {} | function mailstream_module() {} | ||||||
| 
 | 
 | ||||||
| function mailstream_plugin_admin(&$a,&$o) { | function mailstream_addon_admin(&$a,&$o) { | ||||||
| 	$frommail = Config::get('mailstream', 'frommail'); | 	$frommail = Config::get('mailstream', 'frommail'); | ||||||
| 	$template = get_markup_template('admin.tpl', 'addon/mailstream/'); | 	$template = get_markup_template('admin.tpl', 'addon/mailstream/'); | ||||||
| 	$config = ['frommail', | 	$config = ['frommail', | ||||||
|  | @ -78,7 +78,7 @@ function mailstream_plugin_admin(&$a,&$o) { | ||||||
| 				 '$submit' => t('Save Settings')]); | 				 '$submit' => t('Save Settings')]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function mailstream_plugin_admin_post ($a) { | function mailstream_addon_admin_post ($a) { | ||||||
| 	if (x($_POST, 'frommail')) { | 	if (x($_POST, 'frommail')) { | ||||||
| 		Config::set('mailstream', 'frommail', $_POST['frommail']); | 		Config::set('mailstream', 'frommail', $_POST['frommail']); | ||||||
| 	} | 	} | ||||||
|  | @ -266,7 +266,7 @@ function mailstream_send($a, $message_id, $item, $user) { | ||||||
| 	} | 	} | ||||||
| 	$mail = new PHPmailer; | 	$mail = new PHPmailer; | ||||||
| 	try { | 	try { | ||||||
| 		$mail->XMailer = 'Friendica Mailstream Plugin'; | 		$mail->XMailer = 'Friendica Mailstream Addon'; | ||||||
| 		$mail->SetFrom($frommail, mailstream_sender($item)); | 		$mail->SetFrom($frommail, mailstream_sender($item)); | ||||||
| 		$mail->AddAddress($address, $user['username']); | 		$mail->AddAddress($address, $user['username']); | ||||||
| 		$mail->MessageID = $message_id; | 		$mail->MessageID = $message_id; | ||||||
|  | @ -346,7 +346,7 @@ function mailstream_cron($a, $b) { | ||||||
| 	mailstream_tidy(); | 	mailstream_tidy(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function mailstream_plugin_settings(&$a,&$s) { | function mailstream_addon_settings(&$a,&$s) { | ||||||
| 	$enabled = PConfig::get(local_user(), 'mailstream', 'enabled'); | 	$enabled = PConfig::get(local_user(), 'mailstream', 'enabled'); | ||||||
| 	$address = PConfig::get(local_user(), 'mailstream', 'address'); | 	$address = PConfig::get(local_user(), 'mailstream', 'address'); | ||||||
| 	$nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes'); | 	$nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes'); | ||||||
|  | @ -376,7 +376,7 @@ function mailstream_plugin_settings(&$a,&$s) { | ||||||
| 				 '$submit' => t('Save Settings')]); | 				 '$submit' => t('Save Settings')]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function mailstream_plugin_settings_post($a,$post) { | function mailstream_addon_settings_post($a,$post) { | ||||||
| 	if ($_POST['mailstream_address'] != "") { | 	if ($_POST['mailstream_address'] != "") { | ||||||
| 		PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); | 		PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -13,14 +13,14 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function mathjax_install() { | function mathjax_install() { | ||||||
|     Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header'); |     Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header'); | ||||||
|     Addon::registerHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings'); |     Addon::registerHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings'); | ||||||
|     Addon::registerHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post'); |     Addon::registerHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post'); | ||||||
|     logger('installed js_math plugin'); |     logger('installed js_math addon'); | ||||||
| } | } | ||||||
| function mathjax_uninstall() { | function mathjax_uninstall() { | ||||||
|     Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header'); |     Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header'); | ||||||
|     Addon::unregisterHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings'); |     Addon::unregisterHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings'); | ||||||
|     Addon::unregisterHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post'); |     Addon::unregisterHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post'); | ||||||
| } | } | ||||||
| function mathjax_settings_post ($a, $post) { | function mathjax_settings_post ($a, $post) { | ||||||
|     if (! local_user()) |     if (! local_user()) | ||||||
|  | @ -68,12 +68,12 @@ function mathjax_page_header($a, &$b) { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 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'); |     $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); |     Config::set('mathjax','baseurl',$baseurl); | ||||||
|     info( t('Settings updated.'). EOL); |     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/" ); | 	$t = get_markup_template( "admin.tpl", "addon/mathjax/" ); | ||||||
| 	if (Config::get('mathjax','baseurl','') == '') { | 	if (Config::get('mathjax','baseurl','') == '') { | ||||||
| 		Config::set('mathjax','baseurl','http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'); | 		Config::set('mathjax','baseurl','http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'); | ||||||
|  |  | ||||||
|  | @ -1,5 +1,4 @@ | ||||||
| <?php | <?php | ||||||
| 
 |  | ||||||
| /** | /** | ||||||
|  * Name: MemberSince |  * Name: MemberSince | ||||||
|  * Description: Display membership date in profile |  * Description: Display membership date in profile | ||||||
|  | @ -9,13 +8,23 @@ | ||||||
|  */ |  */ | ||||||
| use Friendica\Core\Addon; | 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() | ||||||
| 
 | { | ||||||
| function membersince_uninstall(){ Addon::unregisterHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); } | 	Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); | ||||||
| 
 | } | ||||||
| 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);  | function membersince_uninstall() | ||||||
| //$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); 
 | { | ||||||
|  | 	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); | ||||||
|  | 
 | ||||||
|  | 	// 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);
 | ||||||
| } | } | ||||||
|  | @ -37,7 +37,7 @@ function newmemberwidget_network_mod_init ( $a, $b) { | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function newmemberwidget_plugin_admin_post( &$a ) { | function newmemberwidget_addon_admin_post( &$a ) { | ||||||
|     $ft = ((x($_POST, 'freetext')) ? trim($_POST['freetext']) : ""); |     $ft = ((x($_POST, 'freetext')) ? trim($_POST['freetext']) : ""); | ||||||
|     $lsn = ((x($_POST, 'localsupportname')) ? notags(trim($_POST['localsupportname'])) : ""); |     $lsn = ((x($_POST, 'localsupportname')) ? notags(trim($_POST['localsupportname'])) : ""); | ||||||
|     $gs = intval($_POST['linkglobalsupport']); |     $gs = intval($_POST['linkglobalsupport']); | ||||||
|  | @ -48,7 +48,7 @@ function newmemberwidget_plugin_admin_post( &$a ) { | ||||||
|     Config::set ( 'newmemberwidget', 'localsupport',       trim($lsn)); |     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'); |     $t = get_markup_template('admin.tpl','addon/newmemberwidget'); | ||||||
|     $o = replace_macros($t, [ |     $o = replace_macros($t, [ | ||||||
| 	'$submit' => t('Save Settings'), | 	'$submit' => t('Save Settings'), | ||||||
|  |  | ||||||
|  | @ -21,7 +21,7 @@ function notifyall_uninstall() { | ||||||
| 
 | 
 | ||||||
| function notifyall_module() {} | 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/>'; | 	$o = '<div></div>    <a href="' . z_root() . '/notifyall">' . t('Send email to all members') . '</a></br/>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,15 +12,15 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function notimeline_install() { | function notimeline_install() { | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); | 	Addon::registerHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function notimeline_uninstall() { | function notimeline_uninstall() { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,16 +11,16 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function nsfw_install() { | function nsfw_install() { | ||||||
| 	Addon::registerHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body', 10); | 	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('addon_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_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function nsfw_uninstall() { | function nsfw_uninstall() { | ||||||
| 	Addon::unregisterHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body'); | 	Addon::unregisterHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -83,7 +83,7 @@ function nsfw_addon_settings(&$a,&$s) { | ||||||
|     $s .= '</span>'; |     $s .= '</span>'; | ||||||
| 
 | 
 | ||||||
|     $s .= '<div id="nsfw-wrapper">'; |     $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 .= '<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 .= '<input id="nsfw-enable" type="checkbox" name="nsfw-enable" value="1"' . $enable_checked . ' />'; | ||||||
| 	$s .= '<div class="clear"></div>'; | 	$s .= '<div class="clear"></div>'; | ||||||
|  |  | ||||||
|  | @ -10,8 +10,8 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function numfriends_install() { | function numfriends_install() { | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); | 	Addon::registerHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed numfriends"); | 	logger("installed numfriends"); | ||||||
| } | } | ||||||
|  | @ -19,15 +19,13 @@ function numfriends_install() { | ||||||
| 
 | 
 | ||||||
| function numfriends_uninstall() { | function numfriends_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed numfriends"); | 	logger("removed numfriends"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Callback from the settings post function. |  * Callback from the settings post function. | ||||||
|  | @ -36,7 +34,6 @@ function numfriends_uninstall() { | ||||||
|  * and if so set our configuration setting for this person. |  * and if so set our configuration setting for this person. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
| 
 |  | ||||||
| function numfriends_settings_post($a,$post) { | function numfriends_settings_post($a,$post) { | ||||||
| 	if(! local_user() || (! x($_POST,'numfriends-submit'))) | 	if(! local_user() || (! x($_POST,'numfriends-submit'))) | ||||||
| 		return; | 		return; | ||||||
|  | @ -48,13 +45,10 @@ function numfriends_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form.  |  * Called from the Addon Setting form.  | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| function numfriends_settings(&$a, &$s) | function numfriends_settings(&$a, &$s) | ||||||
| { | { | ||||||
| 	if (! local_user()) { | 	if (! local_user()) { | ||||||
|  |  | ||||||
|  | @ -163,7 +163,7 @@ function openstreetmap_generate_map(&$a, &$b) | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function openstreetmap_plugin_admin(&$a, &$o) | function openstreetmap_addon_admin(&$a, &$o) | ||||||
| { | { | ||||||
| 	$t = get_markup_template("admin.tpl", "addon/openstreetmap/"); | 	$t = get_markup_template("admin.tpl", "addon/openstreetmap/"); | ||||||
| 	$tmsserver = Config::get('openstreetmap', 'tmsserver'); | 	$tmsserver = Config::get('openstreetmap', 'tmsserver'); | ||||||
|  | @ -192,7 +192,7 @@ function openstreetmap_plugin_admin(&$a, &$o) | ||||||
| 	]); | 	]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function openstreetmap_plugin_admin_post(&$a) | function openstreetmap_addon_admin_post(&$a) | ||||||
| { | { | ||||||
| 	$urltms = ((x($_POST, 'tmsserver')) ? notags(trim($_POST['tmsserver'])) : ''); | 	$urltms = ((x($_POST, 'tmsserver')) ? notags(trim($_POST['tmsserver'])) : ''); | ||||||
| 	$urlnom = ((x($_POST, 'nomserver')) ? notags(trim($_POST['nomserver'])) : ''); | 	$urlnom = ((x($_POST, 'nomserver')) ? notags(trim($_POST['nomserver'])) : ''); | ||||||
|  |  | ||||||
|  | @ -12,16 +12,16 @@ use Friendica\Core\Config; | ||||||
| 
 | 
 | ||||||
| function pageheader_install() { | function pageheader_install() { | ||||||
|     Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); |     Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function pageheader_uninstall() { | function pageheader_uninstall() { | ||||||
|     Addon::unregisterHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); |     Addon::unregisterHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	// hook moved, uninstall the old one if still there. 
 | 	// hook moved, uninstall the old one if still there. 
 | ||||||
|     Addon::unregisterHook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); |     Addon::unregisterHook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); | ||||||
|  |  | ||||||
|  | @ -1,13 +1,13 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: Piwik Analytics |  * Name: Piwik Analytics | ||||||
|  * Description: Piwik Analytics Plugin for Friendica |  * Description: Piwik Analytics Addon for Friendica | ||||||
|  * Version: 1.3 |  * Version: 1.3 | ||||||
|  * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias> |  * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias> | ||||||
|  * Author: Klaus Weidenbach |  * Author: Klaus Weidenbach | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| /*   Piwik Analytics Plugin for Friendica | /*   Piwik Analytics Addon for Friendica | ||||||
|  * |  * | ||||||
|  *   Author: Tobias Diekershoff |  *   Author: Tobias Diekershoff | ||||||
|  *           tobias.diekershoff@gmx.net |  *           tobias.diekershoff@gmx.net | ||||||
|  | @ -35,19 +35,19 @@ use Friendica\Core\Config; | ||||||
| function piwik_install() { | function piwik_install() { | ||||||
| 	Addon::registerHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); | 	Addon::registerHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed piwik plugin"); | 	logger("installed piwik addon"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function piwik_uninstall() { | function piwik_uninstall() { | ||||||
| 	Addon::unregisterHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); | 	Addon::unregisterHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); | ||||||
| 
 | 
 | ||||||
| 	logger("uninstalled piwik plugin"); | 	logger("uninstalled piwik addon"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function piwik_analytics($a,&$b) { | 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 | 	 *   associated CSS file. We just have to tell Friendica to get it | ||||||
| 	 *   into the page header. | 	 *   into the page header. | ||||||
| 	 */ | 	 */ | ||||||
|  | @ -85,7 +85,7 @@ function piwik_analytics($a,&$b) { | ||||||
| 		$b .= "</div>"; | 		$b .= "</div>"; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| function piwik_plugin_admin (&$a, &$o) { | function piwik_addon_admin (&$a, &$o) { | ||||||
| 	$t = get_markup_template( "admin.tpl", "addon/piwik/" ); | 	$t = get_markup_template( "admin.tpl", "addon/piwik/" ); | ||||||
| 	$o = replace_macros( $t, [ | 	$o = replace_macros( $t, [ | ||||||
| 		'$submit' => t('Save Settings'), | 		'$submit' => t('Save Settings'), | ||||||
|  | @ -95,7 +95,7 @@ function piwik_plugin_admin (&$a, &$o) { | ||||||
| 		'$async' => ['async', t('Asynchronous tracking'), Config::get('piwik','async' ), ''], | 		'$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'])) : ''); | 	$url = ((x($_POST, 'baseurl')) ? notags(trim($_POST['baseurl'])) : ''); | ||||||
| 	$id = ((x($_POST, 'siteid')) ? trim($_POST['siteid']) : ''); | 	$id = ((x($_POST, 'siteid')) ? trim($_POST['siteid']) : ''); | ||||||
| 	$optout = ((x($_POST, 'optout')) ? trim($_POST['optout']) : ''); | 	$optout = ((x($_POST, 'optout')) ? trim($_POST['optout']) : ''); | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: Random Planet, Empirial Version |  * 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 |  * Version: 1.0 | ||||||
|  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike> |  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike> | ||||||
|  * Author: Tony Baldwin <https://free-haven.org/profile/tony> |  * Author: Tony Baldwin <https://free-haven.org/profile/tony> | ||||||
|  | @ -13,7 +13,7 @@ function planets_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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. | 	 * The first is just prior to storing a local post. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
|  | @ -22,14 +22,14 @@ function planets_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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 | 	 * settings post hook so that we can create and update | ||||||
| 	 * user preferences. | 	 * user preferences. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/planets/planets.php', 'planets_settings'); | 	Addon::registerHook('addon_settings', 'addon/planets/planets.php', 'planets_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed planets"); | 	logger("installed planets"); | ||||||
| } | } | ||||||
|  | @ -46,8 +46,8 @@ function planets_uninstall() { | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('post_local',    'addon/planets/planets.php', 'planets_post_hook'); | 	Addon::unregisterHook('post_local',    'addon/planets/planets.php', 'planets_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/planets/planets.php', 'planets_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/planets/planets.php', 'planets_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed planets"); | 	logger("removed planets"); | ||||||
|  | @ -62,7 +62,7 @@ function planets_post_hook($a, &$item) { | ||||||
| 	 * An item was posted on the local system. | 	 * An item was posted on the local system. | ||||||
| 	 * We are going to look for specific items: | 	 * We are going to look for specific items: | ||||||
| 	 *      - A status post by a profile owner | 	 *      - A status post by a profile owner | ||||||
| 	 *      - The profile owner must have allowed our plugin | 	 *      - The profile owner must have allowed our addon | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
|  | @ -123,7 +123,7 @@ function planets_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form. |  * Called from the Addon Setting form. | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  | @ -158,7 +158,7 @@ function planets_settings(&$a,&$s) { | ||||||
|     $s .= '<div class="settings-block">'; |     $s .= '<div class="settings-block">'; | ||||||
| 	$s .= '<h3>' . t('Planets Settings') . '</h3>'; | 	$s .= '<h3>' . t('Planets Settings') . '</h3>'; | ||||||
| 	$s .= '<div id="planets-enable-wrapper">'; | 	$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 .= '<input id="planets-checkbox" type="checkbox" name="planets" value="1" ' . $checked . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div></div>'; | 	$s .= '</div><div class="clear"></div></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,14 +12,14 @@ use Friendica\Core\Config; | ||||||
| 
 | 
 | ||||||
| function pledgie_install() {  | function pledgie_install() {  | ||||||
| 	Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');  | 	Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');  | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function pledgie_uninstall() {  | function pledgie_uninstall() {  | ||||||
| 	Addon::unregisterHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); | 	Addon::unregisterHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function pledgie_addon_settings(&$a,&$s) { | function pledgie_addon_settings(&$a,&$s) { | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: public_server |  * 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 |  * Version: 1.1 | ||||||
|  * Author: Keith Fernie <http://friendika.me4.it/profile/keith> |  * Author: Keith Fernie <http://friendika.me4.it/profile/keith> | ||||||
|  */ |  */ | ||||||
|  | @ -141,8 +141,8 @@ function public_server_login($a,$b) { | ||||||
| 	); | 	); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function public_server_plugin_admin_post ( &$a ) { | function public_server_addon_admin_post ( &$a ) { | ||||||
|     check_form_security_token_redirectOnErr('/admin/plugins/publicserver', 'publicserver'); |     check_form_security_token_redirectOnErr('/admin/addons/publicserver', 'publicserver'); | ||||||
|     $expiredays = (( x($_POST, 'expiredays') ) ? notags(trim($_POST['expiredays'] )) : ''); |     $expiredays = (( x($_POST, 'expiredays') ) ? notags(trim($_POST['expiredays'] )) : ''); | ||||||
|     $expireposts = (( x($_POST, 'expireposts') ) ? notags(trim($_POST['expireposts'] )) : ''); |     $expireposts = (( x($_POST, 'expireposts') ) ? notags(trim($_POST['expireposts'] )) : ''); | ||||||
|     $nologin = (( x($_POST, 'nologin') ) ? notags(trim($_POST['nologin'] )) : ''); |     $nologin = (( x($_POST, 'nologin') ) ? notags(trim($_POST['nologin'] )) : ''); | ||||||
|  | @ -157,7 +157,7 @@ function public_server_plugin_admin_post ( &$a ) { | ||||||
|     Config::set( 'public_server','flagpostsexpire',$flagpostsexpire ); |     Config::set( 'public_server','flagpostsexpire',$flagpostsexpire ); | ||||||
|     info( t('Settings saved').EOL ); |     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"); |     $token = get_form_security_token("publicserver"); | ||||||
|     $t = get_markup_template( "admin.tpl", "addon/public_server"); |     $t = get_markup_template( "admin.tpl", "addon/public_server"); | ||||||
|     $o = replace_macros($t, [ |     $o = replace_macros($t, [ | ||||||
|  |  | ||||||
|  | @ -9,7 +9,7 @@ | ||||||
|  *  |  *  | ||||||
|  * Provides a set of text "snippets" which can be inserted into a comment window by clicking on them. |  * 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.  |  * 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 |  * 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  |  * of words is suggested. These can be accepted (click Submit) or edited first. Each text line represents  | ||||||
|  * a different qcomment.  |  * a different qcomment.  | ||||||
|  | @ -23,15 +23,15 @@ use Friendica\Core\Addon; | ||||||
| use Friendica\Core\PConfig; | use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function qcomment_install() { | function qcomment_install() { | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function qcomment_uninstall() { | function qcomment_uninstall() { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <?php | <?php | ||||||
| /** | /** | ||||||
|  * Name: Random place |  * 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 |  * Version: 1.0 | ||||||
|  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike> |  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike> | ||||||
|  * |  * | ||||||
|  | @ -11,7 +11,7 @@ | ||||||
|  * Addons are registered with the system through the admin |  * Addons are registered with the system through the admin | ||||||
|  * panel. |  * 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', |  * name_install() function, located in 'addon/name/name.php', | ||||||
|  * where 'name' is the name of the addon. |  * where 'name' is the name of the addon. | ||||||
|  * If the addon is removed from the configuration list, the |  * If the addon is removed from the configuration list, the | ||||||
|  | @ -25,7 +25,7 @@ function randplace_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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. | 	 * The first is just prior to storing a local post. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
|  | @ -34,14 +34,14 @@ function randplace_install() { | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * | 	 * | ||||||
| 	 * 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 | 	 * settings post hook so that we can create and update | ||||||
| 	 * user preferences. | 	 * user preferences. | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings'); | 	Addon::registerHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed randplace"); | 	logger("installed randplace"); | ||||||
| } | } | ||||||
|  | @ -58,8 +58,8 @@ function randplace_uninstall() { | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('post_local',    'addon/randplace/randplace.php', 'randplace_post_hook'); | 	Addon::unregisterHook('post_local',    'addon/randplace/randplace.php', 'randplace_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	logger("removed randplace"); | 	logger("removed randplace"); | ||||||
|  | @ -74,7 +74,7 @@ function randplace_post_hook($a, &$item) { | ||||||
| 	 * An item was posted on the local system. | 	 * An item was posted on the local system. | ||||||
| 	 * We are going to look for specific items: | 	 * We are going to look for specific items: | ||||||
| 	 *      - A status post by a profile owner | 	 *      - A status post by a profile owner | ||||||
| 	 *      - The profile owner must have allowed our plugin | 	 *      - The profile owner must have allowed our addon | ||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 
 | 
 | ||||||
|  | @ -142,7 +142,7 @@ function randplace_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form. |  * Called from the Addon Setting form. | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  | @ -169,7 +169,7 @@ function randplace_settings(&$a,&$s) { | ||||||
| 	$s .= '<div class="settings-block">'; | 	$s .= '<div class="settings-block">'; | ||||||
| 	$s .= '<h3>' . t('Randplace Settings') . '</h3>'; | 	$s .= '<h3>' . t('Randplace Settings') . '</h3>'; | ||||||
| 	$s .= '<div id="randplace-enable-wrapper">'; | 	$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 .= '<input id="randplace-checkbox" type="checkbox" name="randplace" value="1" ' . $checked . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,14 +12,14 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function remote_permissions_install() { | function remote_permissions_install() { | ||||||
| 	Addon::registerHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content'); | 	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('addon_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_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function remote_permissions_uninstall() { | function remote_permissions_uninstall() { | ||||||
| 	Addon::unregisterHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content'); | 	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('addon_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_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function remote_permissions_settings(&$a,&$o) { | function remote_permissions_settings(&$a,&$o) { | ||||||
|  | @ -192,7 +192,7 @@ function remote_permissions_content($a, $item_copy) { | ||||||
| 	return; | 	return; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function remote_permissions_plugin_admin(&$a, &$o){ | function remote_permissions_addon_admin(&$a, &$o){ | ||||||
| 	$t = get_markup_template( "admin.tpl", "addon/remote_permissions/" ); | 	$t = get_markup_template( "admin.tpl", "addon/remote_permissions/" ); | ||||||
| 	$o = replace_macros($t, [ | 	$o = replace_macros($t, [ | ||||||
| 		'$submit' => t('Save Settings'), | 		'$submit' => t('Save Settings'), | ||||||
|  | @ -201,7 +201,7 @@ function remote_permissions_plugin_admin(&$a, &$o){ | ||||||
| 	]); | 	]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function remote_permissions_plugin_admin_post(&$a){ | function remote_permissions_addon_admin_post(&$a){ | ||||||
| 	$choice	=	((x($_POST,'remotepermschoice'))		? notags(trim($_POST['remotepermschoice']))	: ''); | 	$choice	=	((x($_POST,'remotepermschoice'))		? notags(trim($_POST['remotepermschoice']))	: ''); | ||||||
| 	Config::set('remote_perms','global',($choice == 1 ? 1 : 0)); | 	Config::set('remote_perms','global',($choice == 1 ? 1 : 0)); | ||||||
| 	info( t('Settings updated.'). EOL ); | 	info( t('Settings updated.'). EOL ); | ||||||
|  |  | ||||||
|  | @ -24,8 +24,8 @@ require_once 'openpgp_crypt_symmetric.php'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function securemail_install() { | function securemail_install() { | ||||||
|     Addon::registerHook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings'); |     Addon::registerHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings'); | ||||||
|     Addon::registerHook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post'); |     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'); |     Addon::registerHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare'); | ||||||
| 
 | 
 | ||||||
|  | @ -33,8 +33,8 @@ function securemail_install() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function securemail_uninstall() { | function securemail_uninstall() { | ||||||
|     Addon::unregisterHook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings'); |     Addon::unregisterHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings'); | ||||||
|     Addon::unregisterHook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post'); |     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'); |     Addon::unregisterHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare'); | ||||||
| 
 | 
 | ||||||
|  | @ -44,7 +44,7 @@ function securemail_uninstall() { | ||||||
| /** | /** | ||||||
|  * @brief Build user settings form |  * @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 App $a App instance | ||||||
|  * @param string $s output html |  * @param string $s output html | ||||||
|  | @ -73,7 +73,7 @@ function securemail_settings(App &$a, &$s){ | ||||||
| /** | /** | ||||||
|  * @brief Handle data from user settings form |  * @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 App $a App instance | ||||||
|  * @param array $b hook data |  * @param array $b hook data | ||||||
|  | @ -138,7 +138,7 @@ function securemail_settings_post(App &$a, array &$b){ | ||||||
| /** | /** | ||||||
|  * @brief Encrypt notification emails text |  * @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 App $a App instance | ||||||
|  * @param array $b hook data |  * @param array $b hook data | ||||||
|  |  | ||||||
|  | @ -12,14 +12,14 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function showmore_install() { | function showmore_install() { | ||||||
| 	Addon::registerHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); | 	Addon::registerHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function showmore_uninstall() { | function showmore_uninstall() { | ||||||
| 	Addon::unregisterHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); | 	Addon::unregisterHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function showmore_addon_settings(&$a,&$s) { | function showmore_addon_settings(&$a,&$s) { | ||||||
|  |  | ||||||
|  | @ -11,15 +11,15 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function startpage_install() { | function startpage_install() { | ||||||
| 	Addon::registerHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); | 	Addon::registerHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings'); | 	Addon::registerHook('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function startpage_uninstall() { | function startpage_uninstall() { | ||||||
| 	Addon::unregisterHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); | 	Addon::unregisterHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -54,7 +54,7 @@ function startpage_settings_post($a,$post) { | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  * Called from the Plugin Setting form. |  * Called from the Addon Setting form. | ||||||
|  * Add our own settings info to the page. |  * Add our own settings info to the page. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | @ -170,8 +170,8 @@ function statusnet_uninstall() | ||||||
| 
 | 
 | ||||||
| 	// old setting - remove only
 | 	// old setting - remove only
 | ||||||
| 	Addon::unregisterHook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); | 	Addon::unregisterHook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function statusnet_check_item_notification(App $a, &$notification_data) | function statusnet_check_item_notification(App $a, &$notification_data) | ||||||
|  | @ -707,7 +707,7 @@ function statusnet_post_hook(App $a, &$b) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function statusnet_plugin_admin_post(App $a) | function statusnet_addon_admin_post(App $a) | ||||||
| { | { | ||||||
| 	$sites = []; | 	$sites = []; | ||||||
| 
 | 
 | ||||||
|  | @ -739,7 +739,7 @@ function statusnet_plugin_admin_post(App $a) | ||||||
| 	$sites = Config::set('statusnet', 'sites', $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'); | 	$sites = Config::get('statusnet', 'sites'); | ||||||
| 	$sitesform = []; | 	$sitesform = []; | ||||||
|  |  | ||||||
|  | @ -13,8 +13,8 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function superblock_install() { | function superblock_install() { | ||||||
| 
 | 
 | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); | ||||||
| 	Addon::registerHook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); | 	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('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); | ||||||
| 	Addon::registerHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); | 	Addon::registerHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); | ||||||
|  | @ -24,8 +24,8 @@ function superblock_install() { | ||||||
| 
 | 
 | ||||||
| function superblock_uninstall() { | function superblock_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); | ||||||
| 	Addon::unregisterHook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); | 	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('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); | ||||||
| 	Addon::unregisterHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); | 	Addon::unregisterHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); | ||||||
|  |  | ||||||
|  | @ -58,7 +58,7 @@ function tumblr_content(&$a) { | ||||||
| 	return $o; | 	return $o; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function tumblr_plugin_admin(&$a, &$o){ | function tumblr_addon_admin(&$a, &$o){ | ||||||
|         $t = get_markup_template( "admin.tpl", "addon/tumblr/" ); |         $t = get_markup_template( "admin.tpl", "addon/tumblr/" ); | ||||||
| 
 | 
 | ||||||
|         $o = replace_macros($t, [ |         $o = replace_macros($t, [ | ||||||
|  | @ -69,7 +69,7 @@ function tumblr_plugin_admin(&$a, &$o){ | ||||||
|         ]); |         ]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function tumblr_plugin_admin_post(&$a){ | function tumblr_addon_admin_post(&$a){ | ||||||
|         $consumer_key     =       ((x($_POST,'consumer_key'))              ? notags(trim($_POST['consumer_key']))   : ''); |         $consumer_key     =       ((x($_POST,'consumer_key'))              ? notags(trim($_POST['consumer_key']))   : ''); | ||||||
|         $consumer_secret =       ((x($_POST,'consumer_secret'))   ? notags(trim($_POST['consumer_secret'])): ''); |         $consumer_secret =       ((x($_POST,'consumer_secret'))   ? notags(trim($_POST['consumer_secret'])): ''); | ||||||
|         Config::set('tumblr','consumer_key',$consumer_key); |         Config::set('tumblr','consumer_key',$consumer_key); | ||||||
|  | @ -218,7 +218,7 @@ function tumblr_settings(&$a,&$s) { | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
| 	$s .= '<div id="tumblr-enable-wrapper">'; | 	$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 .= '<input id="tumblr-checkbox" type="checkbox" name="tumblr" value="1" ' . $checked . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ | ||||||
|  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
| /*   Twitter Plugin for Friendica | /*   Twitter Addon for Friendica | ||||||
|  * |  * | ||||||
|  *   Author: Tobias Diekershoff |  *   Author: Tobias Diekershoff | ||||||
|  *           tobias.diekershoff@gmx.net |  *           tobias.diekershoff@gmx.net | ||||||
|  | @ -41,7 +41,7 @@ | ||||||
|  *   License:3-clause BSD license |  *   License:3-clause BSD license | ||||||
|  * |  * | ||||||
|  *   Configuration: |  *   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 |  *     you can get it from Twitter at https://twitter.com/apps | ||||||
|  * |  * | ||||||
|  *     Register your Friendica site as "Client" application with "Read & Write" access |  *     Register your Friendica site as "Client" application with "Read & Write" access | ||||||
|  | @ -53,9 +53,9 @@ | ||||||
|  *     $a->config['twitter']['consumerkey'] = 'your consumer_key here'; |  *     $a->config['twitter']['consumerkey'] = 'your consumer_key here'; | ||||||
|  *     $a->config['twitter']['consumersecret'] = 'your consumer_secret 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 |  *     setting. After this, your user can configure their Twitter account settings | ||||||
|  *     from "Settings -> Plugin Settings". |  *     from "Settings -> Addon Settings". | ||||||
|  * |  * | ||||||
|  *     Requirements: PHP5, curl [Slinky library] |  *     Requirements: PHP5, curl [Slinky library] | ||||||
|  */ |  */ | ||||||
|  | @ -109,8 +109,8 @@ function twitter_uninstall() | ||||||
| 
 | 
 | ||||||
| 	// old setting - remove only
 | 	// old setting - remove only
 | ||||||
| 	Addon::unregisterHook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); | 	Addon::unregisterHook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/twitter/twitter.php', 'twitter_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function twitter_check_item_notification(App $a, &$notification_data) | function twitter_check_item_notification(App $a, &$notification_data) | ||||||
|  | @ -301,7 +301,7 @@ function twitter_settings(App $a, &$s) | ||||||
| 			/*			 * * | 			/*			 * * | ||||||
| 			 *  make some nice form | 			 *  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 .= '<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 .= '<div id="twitter-pin-wrapper">'; | ||||||
| 			$s .= '<label id="twitter-pin-label" for="twitter-pin">' . t('Copy the PIN from Twitter here') . '</label>'; | 			$s .= '<label id="twitter-pin-label" for="twitter-pin">' . t('Copy the PIN from Twitter here') . '</label>'; | ||||||
|  | @ -641,7 +641,7 @@ function twitter_post_hook(App $a, &$b) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function twitter_plugin_admin_post(App $a) | function twitter_addon_admin_post(App $a) | ||||||
| { | { | ||||||
| 	$consumerkey     = x($_POST, 'consumerkey')     ? notags(trim($_POST['consumerkey']))     : ''; | 	$consumerkey     = x($_POST, 'consumerkey')     ? notags(trim($_POST['consumerkey']))     : ''; | ||||||
| 	$consumersecret  = x($_POST, 'consumersecret')  ? notags(trim($_POST['consumersecret']))  : ''; | 	$consumersecret  = x($_POST, 'consumersecret')  ? notags(trim($_POST['consumersecret']))  : ''; | ||||||
|  | @ -650,7 +650,7 @@ function twitter_plugin_admin_post(App $a) | ||||||
| 	info(t('Settings updated.') . EOL); | 	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/"); | 	$t = get_markup_template("admin.tpl", "addon/twitter/"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -22,14 +22,14 @@ function webrtc_app_menu($a,&$b) { | ||||||
| 	$b['app_menu'][] = '<div class="app-title"><a href="webrtc">' . t('WebRTC Videochat') . '</a></div>'; | 	$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/" ); |         $t = get_markup_template( "admin.tpl", "addon/webrtc/" ); | ||||||
| 	$o = replace_macros( $t, [ | 	$o = replace_macros( $t, [ | ||||||
| 	    '$submit' => t('Save Settings'), | 	    '$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 .')], | 	    '$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'])) : ''); |         $url = ((x($_POST, 'webrtcurl')) ? notags(trim($_POST['webrtcurl'])) : ''); | ||||||
| 	    Config::set('webrtc', 'webrtcurl', $url); | 	    Config::set('webrtc', 'webrtcurl', $url); | ||||||
| 	    info( t('Settings updated.'). EOL); | 	    info( t('Settings updated.'). EOL); | ||||||
|  |  | ||||||
|  | @ -9,13 +9,13 @@ use Friendica\Core\Addon; | ||||||
| use Friendica\Core\PConfig; | use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function widgets_install() { | function widgets_install() { | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings'); | 	Addon::registerHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); | ||||||
| 	logger("installed widgets"); | 	logger("installed widgets"); | ||||||
| } | } | ||||||
| function widgets_uninstall() { | function widgets_uninstall() { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -122,7 +122,7 @@ function widgets_content(&$a) { | ||||||
| 		if (isset($_GET['p']) && local_user()==$conf['uid'] ) { | 		if (isset($_GET['p']) && local_user()==$conf['uid'] ) { | ||||||
| 			$o .= "<style>.f9k_widget { float: left;border:1px solid black; }</style>"; | 			$o .= "<style>.f9k_widget { float: left;border:1px solid black; }</style>"; | ||||||
| 			$o .= "<h1>Preview Widget</h1>"; | 			$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 .=  "<h4>".call_user_func($a->argv[1].'_widget_name')."</h4>"; | ||||||
| 			$o .=  call_user_func($a->argv[1].'_widget_help'); | 			$o .=  call_user_func($a->argv[1].'_widget_help'); | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|  * Pre-requisite: Windows Phone mobile device (at least WP 7.0) |  * Pre-requisite: Windows Phone mobile device (at least WP 7.0) | ||||||
|  *                Friendica mobile app on Windows Phone |  *                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', |  * name_install() function, located in 'addon/name/name.php', | ||||||
|  * where 'name' is the name of the addon. |  * where 'name' is the name of the addon. | ||||||
|  * If the addon is removed from the configuration list, the |  * If the addon is removed from the configuration list, the | ||||||
|  | @ -32,19 +32,19 @@ use Friendica\Model\User; | ||||||
| 
 | 
 | ||||||
| function windowsphonepush_install() | 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 | 	 * The first is within cron - so the push notifications will be | ||||||
| 	 * sent every 10 minutes (or whatever is set in crontab). | 	 * sent every 10 minutes (or whatever is set in crontab). | ||||||
| 	 */ | 	 */ | ||||||
| 	Addon::registerHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); | 	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 | 	 * 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 | 	 * define whether he allows pushing first characters of item text | ||||||
| 	 */ | 	 */ | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); | 	Addon::registerHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); | 	Addon::registerHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("installed windowsphonepush"); | 	logger("installed windowsphonepush"); | ||||||
| } | } | ||||||
|  | @ -55,8 +55,8 @@ function windowsphonepush_uninstall() | ||||||
| 	 * during install. Don't delete data in table `pconfig`. | 	 * during install. Don't delete data in table `pconfig`. | ||||||
| 	 */ | 	 */ | ||||||
| 	Addon::unregisterHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); | 	Addon::unregisterHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); | 	Addon::unregisterHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); | ||||||
| 
 | 
 | ||||||
| 	logger("removed windowsphonepush"); | 	logger("removed windowsphonepush"); | ||||||
| } | } | ||||||
|  | @ -89,7 +89,7 @@ function windowsphonepush_settings_post($a, $post) | ||||||
| 	info(t('WindowsPhonePush settings updated.') . EOL); | 	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. |  * Add our own settings info to the page. | ||||||
|  */ |  */ | ||||||
| function windowsphonepush_settings(&$a, &$s) | function windowsphonepush_settings(&$a, &$s) | ||||||
|  | @ -115,7 +115,7 @@ function windowsphonepush_settings(&$a, &$s) | ||||||
| 	$s .= '<h3>' . t('WindowsPhonePush Settings') . '</h3>'; | 	$s .= '<h3>' . t('WindowsPhonePush Settings') . '</h3>'; | ||||||
| 
 | 
 | ||||||
| 	$s .= '<div id="windowsphonepush-enable-wrapper">'; | 	$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 .= '<input id="windowsphonepush-enable-chk" type="checkbox" name="windowsphonepush" value="1" ' . $checked_enabled . '/>'; | ||||||
| 	$s .= '</div><div class="clear"></div>'; | 	$s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  | @ -136,12 +136,12 @@ function windowsphonepush_settings(&$a, &$s) | ||||||
| 	return; | 	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 |  * notifications to the Microsoft servers and consequently to the Windows Phone device | ||||||
|  */ |  */ | ||||||
| function windowsphonepush_cron() | 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"); | 	$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'windowsphonepush' AND `k` = 'enable' AND `v` = 1"); | ||||||
| 	if (count($r)) { | 	if (count($r)) { | ||||||
| 		foreach ($r as $rr) { | 		foreach ($r as $rr) { | ||||||
|  | @ -152,7 +152,7 @@ function windowsphonepush_cron() | ||||||
| 			// pushing only possible if device_url (the URI on Microsoft server) is available or not "NA" (which will be sent
 | 			// 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)
 | 			// 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" )) { | 			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."); | 				logger("WARN: windowsphonepush is enable for user " . $rr['uid'] . ", but no Device-URL is specified for the user."); | ||||||
| 			} else { | 			} else { | ||||||
| 				// retrieve the number of unseen items and the id of the latest one (if there are more than
 | 				// retrieve the number of unseen items and the id of the latest one (if there are more than
 | ||||||
|  | @ -393,7 +393,7 @@ function windowsphonepush_updatesettings() | ||||||
| 		return "Not Authenticated"; | 		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'); | 	$enable = PConfig::get(local_user(), 'windowsphonepush', 'enable'); | ||||||
| 	if (!$enable) { | 	if (!$enable) { | ||||||
| 		return "Plug-in not enabled"; | 		return "Plug-in not enabled"; | ||||||
|  | @ -434,7 +434,7 @@ function windowsphonepush_updatecounterunseen() | ||||||
| 		return "Not Authenticated"; | 		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'); | 	$enable = PConfig::get(local_user(), 'windowsphonepush', 'enable'); | ||||||
| 	if (!$enable) { | 	if (!$enable) { | ||||||
| 		return "Plug-in not enabled"; | 		return "Plug-in not enabled"; | ||||||
|  |  | ||||||
|  | @ -26,8 +26,8 @@ function wppost_uninstall() { | ||||||
| 
 | 
 | ||||||
| 	// obsolete - remove
 | 	// obsolete - remove
 | ||||||
|     Addon::unregisterHook('post_local_end',   'addon/wppost/wppost.php', 'wppost_send'); |     Addon::unregisterHook('post_local_end',   'addon/wppost/wppost.php', 'wppost_send'); | ||||||
|     Addon::unregisterHook('plugin_settings',  'addon/wppost/wppost.php', 'wppost_settings'); |     Addon::unregisterHook('addon_settings',  'addon/wppost/wppost.php', 'wppost_settings'); | ||||||
|     Addon::unregisterHook('plugin_settings_post',  'addon/wppost/wppost.php', 'wppost_settings_post'); |     Addon::unregisterHook('addon_settings_post',  'addon/wppost/wppost.php', 'wppost_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -86,7 +86,7 @@ function wppost_settings(&$a,&$s) { | ||||||
|     $s .= '<img class="connector'.$css.'" src="images/wordpress.png" /><h3 class="connector">'. t('Wordpress Export').'</h3>'; |     $s .= '<img class="connector'.$css.'" src="images/wordpress.png" /><h3 class="connector">'. t('Wordpress Export').'</h3>'; | ||||||
|     $s .= '</span>'; |     $s .= '</span>'; | ||||||
|     $s .= '<div id="wppost-enable-wrapper">'; |     $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 .= '<input id="wppost-checkbox" type="checkbox" name="wppost" value="1" ' . $checked . '/>'; | ||||||
|     $s .= '</div><div class="clear"></div>'; |     $s .= '</div><div class="clear"></div>'; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -13,21 +13,21 @@ use Friendica\Core\PConfig; | ||||||
| 
 | 
 | ||||||
| function xmpp_install() | function xmpp_install() | ||||||
| { | { | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings'); | 	Addon::registerHook('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); | ||||||
| 	Addon::registerHook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post'); | 	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('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); | ||||||
| 	Addon::registerHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); | 	Addon::registerHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function xmpp_uninstall() | function xmpp_uninstall() | ||||||
| { | { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings'); | 	Addon::unregisterHook('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); | ||||||
| 	Addon::unregisterHook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post'); | 	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('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); | ||||||
| 	Addon::unregisterHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); | 	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'))) { | 	if (!local_user() || (!x($_POST, 'xmpp-settings-submit'))) { | ||||||
| 		return; | 		return; | ||||||
|  | @ -39,7 +39,7 @@ function xmpp_plugin_settings_post() | ||||||
| 	info(t('XMPP settings updated.') . EOL); | 	info(t('XMPP settings updated.') . EOL); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function xmpp_plugin_settings(App $a, &$s) | function xmpp_addon_settings(App $a, &$s) | ||||||
| { | { | ||||||
| 	if (!local_user()) { | 	if (!local_user()) { | ||||||
| 		return; | 		return; | ||||||
|  | @ -100,7 +100,7 @@ function xmpp_login() | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function xmpp_plugin_admin(App $a, &$o) | function xmpp_addon_admin(App $a, &$o) | ||||||
| { | { | ||||||
| 	$t = get_markup_template("admin.tpl", "addon/xmpp/"); | 	$t = get_markup_template("admin.tpl", "addon/xmpp/"); | ||||||
| 
 | 
 | ||||||
|  | @ -111,7 +111,7 @@ function xmpp_plugin_admin(App $a, &$o) | ||||||
| 	]); | 	]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function xmpp_plugin_admin_post() | function xmpp_addon_admin_post() | ||||||
| { | { | ||||||
| 	$bosh_proxy = ((x($_POST, 'bosh_proxy')) ? trim($_POST['bosh_proxy']) : ''); | 	$bosh_proxy = ((x($_POST, 'bosh_proxy')) ? trim($_POST['bosh_proxy']) : ''); | ||||||
| 	$central_userbase = ((x($_POST, 'central_userbase')) ? intval($_POST['central_userbase']) : false); | 	$central_userbase = ((x($_POST, 'central_userbase')) ? intval($_POST['central_userbase']) : false); | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Name: Yourls |  * 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 |  * Version: 1.0 | ||||||
|  * Author: Keith Fernie <http://friendika.me4.it/profile/keith> |  * Author: Keith Fernie <http://friendika.me4.it/profile/keith> | ||||||
|  *  |  *  | ||||||
|  | @ -12,15 +12,15 @@ use Friendica\Core\Addon; | ||||||
| use Friendica\Core\Config; | use Friendica\Core\Config; | ||||||
| 
 | 
 | ||||||
| function yourls_install() { | function yourls_install() { | ||||||
| 	Addon::registerHook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings'); | 	Addon::registerHook('addon_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_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post'); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function yourls_uninstall() { | function yourls_uninstall() { | ||||||
| 	Addon::unregisterHook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings'); | 	Addon::unregisterHook('addon_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_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post'); | ||||||
| 	Config::set('yourls','url1',trim($_POST[''])); | 	Config::set('yourls','url1',trim($_POST[''])); | ||||||
| 	Config::set('yourls','username1',trim($_POST[''])); | 	Config::set('yourls','username1',trim($_POST[''])); | ||||||
| 	Config::set('yourls','password1',trim($_POST[''])); | 	Config::set('yourls','password1',trim($_POST[''])); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue