Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -24,21 +24,72 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
class _{class}
|
||||
{
|
||||
/**
|
||||
* Get configuration
|
||||
* Get fields for configuration
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param \IPS\Member|null $member The member (to take out any notification types a given member will never see) or NULL if this is for the ACP
|
||||
* @return array
|
||||
*/
|
||||
public function getConfiguration( $member )
|
||||
public static function configurationOptions( \IPS\Member $member = NULL )
|
||||
{
|
||||
// Basically just return a list of the keys for the types of notification your app will send
|
||||
// keys can be anything you want. You can specify what should be the default value and any disabled values (acceptable values are "email" and "inline")
|
||||
// For each key, create a language string "notifications__<key>" which is what will display in the user's Notification Options screen
|
||||
// Return an array defining each notification type, including the form elements necessary to allow its configuration
|
||||
|
||||
return array(
|
||||
'key' => array( 'default' => array( 'inline', 'push' ), 'disabled' => array() ),
|
||||
'setting_key' => array(
|
||||
'type' => 'custom',
|
||||
'adminCanSetDefault'=> TRUE,
|
||||
'field' => \IPS\Helpers\Form\CheckboxSet( 'setting_key', $defaultValue, FALSE, /*...*/ ),
|
||||
'admin_lang' => array(
|
||||
'header' => 'header_lang_key',
|
||||
'title' => 'header_lang_title',
|
||||
),
|
||||
),
|
||||
'other_setting_key' => array(
|
||||
'type' => 'custom',
|
||||
'adminCanSetDefault'=> FALSE,
|
||||
'field' => $formField,
|
||||
),
|
||||
'separator1' => array(
|
||||
'type' => 'separator',
|
||||
),
|
||||
//...
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save "extra" value
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member or NULL if this is the admin setting defaults
|
||||
* @param string $key The key
|
||||
* @param bool $value The value
|
||||
* @return void
|
||||
*/
|
||||
public static function saveExtra( ?\IPS\Member $member, $key, $value )
|
||||
{
|
||||
// You can perform extra processing here to save values in a specific manner if needed
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable all "extra" values for a particular type
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member or NULL if this is the admin setting defaults
|
||||
* @param string $method The method type
|
||||
* @return void
|
||||
*/
|
||||
public static function disableExtra( ?\IPS\Member $member, $method )
|
||||
{
|
||||
// You can disable extra values for a given type, such as if a setting means the notification preference is irrelevant
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset "extra" value to the default for all accounts
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function resetExtra()
|
||||
{
|
||||
// Any extra processing you may need to perform when resetting all members to default notification options.
|
||||
// Typically you won't have to do anything here unless you have custom settings
|
||||
}
|
||||
|
||||
// For each type of notification you need a method like this which controls what will be displayed when the user clicks on the notification icon in the header:
|
||||
// Note that for each type of notification you must *also* create email templates. See documentation for details: https://remoteservices.invisionpower.com/docs/devdocs-notifications
|
||||
@@ -47,6 +98,7 @@ class _{class}
|
||||
* Parse notification: key
|
||||
*
|
||||
* @param \IPS\Notification\Inline $notification The notification
|
||||
* @param bool $htmlEscape TRUE to escape HTML in title
|
||||
* @return array
|
||||
* @code
|
||||
return array(
|
||||
@@ -59,7 +111,7 @@ class _{class}
|
||||
);
|
||||
* @endcode
|
||||
*/
|
||||
public function parse_key( \IPS\Notification\Inline $notification )
|
||||
public function parse_key( \IPS\Notification\Inline $notification, $htmlEscape=TRUE )
|
||||
{
|
||||
return array(
|
||||
'title' => "Mark has replied to A Topic", // The notification title
|
||||
|
||||
Reference in new issue
Block a user