Update function names

update function names and hook calls
This commit is contained in:
Adam Magness 2018-01-20 08:57:41 -05:00
parent 0afd633346
commit c71f7b0e1a
50 changed files with 356 additions and 348 deletions

View file

@ -1,7 +1,7 @@
<?php
/**
* Name: Random place
* Description: Sample Friendica plugin/addon. Set a random place when posting.
* Description: Sample Friendica addon. Set a random place when posting.
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*
@ -11,7 +11,7 @@
* Addons are registered with the system through the admin
* panel.
*
* When registration is detected, the system calls the plugin
* When registration is detected, the system calls the addon
* name_install() function, located in 'addon/name/name.php',
* where 'name' is the name of the addon.
* If the addon is removed from the configuration list, the
@ -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.
*
*/
@ -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
* user preferences.
*
*/
Addon::registerHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
Addon::registerHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
Addon::registerHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings');
Addon::registerHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
logger("installed randplace");
}
@ -58,8 +58,8 @@ function randplace_uninstall() {
*/
Addon::unregisterHook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
Addon::unregisterHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
Addon::unregisterHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings');
Addon::unregisterHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
logger("removed randplace");
@ -74,7 +74,7 @@ function randplace_post_hook($a, &$item) {
* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
* - The profile owner must have allowed our plugin
* - The profile owner must have allowed our addon
*
*/
@ -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.
*
*/
@ -169,7 +169,7 @@ function randplace_settings(&$a,&$s) {
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Randplace Settings') . '</h3>';
$s .= '<div id="randplace-enable-wrapper">';
$s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . t('Enable Randplace Plugin') . '</label>';
$s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . t('Enable Randplace Addon') . '</label>';
$s .= '<input id="randplace-checkbox" type="checkbox" name="randplace" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';