145 lines
3.1 KiB
Plaintext
145 lines
3.1 KiB
Plaintext
<?php
|
|
/**
|
|
* @brief Profile Completion Extension
|
|
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
|
* @copyright (c) Invision Power Services, Inc.
|
|
* @license https://www.invisioncommunity.com/legal/standards/
|
|
* @package Invision Community
|
|
{subpackage}
|
|
* @since {date}
|
|
*/
|
|
|
|
namespace IPS\{app}\extensions\core\ProfileSteps;
|
|
|
|
use IPS\Extensions\ProfileStepsAbstract;
|
|
use IPS\Helpers\Form;
|
|
use IPS\Http\Url;
|
|
use IPS\Member as MemberClass;
|
|
use IPS\Member\ProfileStep;
|
|
use function defined;
|
|
|
|
/* To prevent PHP errors (extending class does not exist) revealing path */
|
|
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
|
{
|
|
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Profile Completion Extension
|
|
*/
|
|
class {class} extends ProfileStepsAbstract
|
|
{
|
|
/**
|
|
* Available Actions to complete steps
|
|
*
|
|
* @return array array( 'key' => 'lang_string' )
|
|
*/
|
|
public static function actions(): array
|
|
{
|
|
return array( );
|
|
}
|
|
|
|
/**
|
|
* Available sub actions to complete steps
|
|
*
|
|
* @return array array( 'key' => 'lang_string' )
|
|
*/
|
|
public static function subActions(): array
|
|
{
|
|
return array( );
|
|
}
|
|
|
|
/**
|
|
* Can the actions have multiple choices?
|
|
*
|
|
* @param string $action Action key (basic_profile, etc)
|
|
* @return bool|null
|
|
*/
|
|
public static function actionMultipleChoice( string $action ): ?bool
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
/**
|
|
* Has a specific step been completed?
|
|
*
|
|
* @param ProfileStep $step The step to check
|
|
* @param MemberClass|NULL $member The member to check, or NULL for currently logged in
|
|
* @return bool
|
|
*/
|
|
public function completed( ProfileStep $step, ?MemberClass $member = NULL ): bool
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
/**
|
|
* Can be set as required?
|
|
*
|
|
* @return array
|
|
* @note This is intended for items which have their own independent settings and dedicated enable pages, such as MFA and Social Login integration
|
|
*/
|
|
public static function canBeRequired(): array
|
|
{
|
|
return array();
|
|
}
|
|
|
|
/**
|
|
* Action URL
|
|
*
|
|
* @param string $action The action
|
|
* @param MemberClass|NULL $member The member, or NULL for currently logged in
|
|
* @return Url|null
|
|
*/
|
|
public function url( string $action, ?MemberClass $member = NULL ): ?Url
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* Post ACP Save
|
|
*
|
|
* @param ProfileStep $step The step
|
|
* @param array $values Form Values
|
|
* @return void
|
|
*/
|
|
public function postAcpSave( ProfileStep $step, array $values ) : void
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* Format Form Values
|
|
*
|
|
* @param array $values The values from the form
|
|
* @param MemberClass $member The member
|
|
* @param Form $form The form
|
|
* @return void
|
|
*/
|
|
public static function formatFormValues( array $values, MemberClass $member, Form $form ) : void
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* Wizard Steps
|
|
*
|
|
* @param MemberClass|null $member Member or NULL for currently logged in member
|
|
* @return array|string
|
|
*/
|
|
public static function wizard( ?MemberClass $member = NULL ): array|string
|
|
{
|
|
return array( );
|
|
}
|
|
|
|
/**
|
|
* Post Delete
|
|
*
|
|
* @param ProfileStep $step The step
|
|
* @return void
|
|
*/
|
|
public function onDelete( ProfileStep $step ) : void
|
|
{
|
|
|
|
}
|
|
} |