Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

@@ -0,0 +1,63 @@
<?php
/**
* @brief AccountSettingsExtension
* @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 7/29/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class AccountSettingsAbstract
{
/**
* @var string
*/
public static string $icon = 'cog';
/**
* Return the key for the tab, or NULL if it should not be displayed
*
* @return string|null
*/
abstract public function getTab() : string|null;
/**
* Return the content for the main tab
*
* @return string
*/
abstract public function getContent() : string;
/**
* Return the language string that will be used as the title.
* Defaults to the tab key.
*
* @return string
*/
public function getTitle() : string
{
return $this->getTab();
}
/**
* Determines if a warning icon should be displayed next to this tab
*
* @return bool
*/
public function showWarning() : bool
{
return false;
}
}
@@ -0,0 +1,62 @@
<?php
/**
* @brief AdvertisementLocationsAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\core\Advertisement;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class AdvertisementLocationsAbstract
{
/**
* If this ad location is used in a list view, we allow the admin
* to define intervals or fixed positions within the list
*
* @var bool
*/
public static bool $listView = false;
/**
* Get the locations and the additional settings
*
* @param array $settings Current setting values
* @return array Array with two elements: 'locations' which should have keys as the location keys and values as the fields to toggle, and 'settings' which are additional fields to add to the form
*/
abstract public function getSettings( array $settings ): array;
/**
* Return an array of setting values to store
*
* @param array $values Values from the form submission
* @return array Array of setting key => value to store
*/
abstract public function parseSettings( array $values ): array;
/**
* Check if the advertisement can be displayed, based on settings
*
* @param Advertisement $advertisement
* @param string $location
* @return bool
*/
public function canShow( Advertisement $advertisement, string $location ) : bool
{
return TRUE;
}
}
@@ -0,0 +1,39 @@
<?php
/**
* @brief AnnouncementsAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\core\Announcements\Announcement;
use IPS\Helpers\Form\FormAbstract;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class AnnouncementsAbstract
{
public static string $idField = "id";
public static array $controllers = array();
/**
* Get Setting Field
*
* @param Announcement|null $announcement
* @return FormAbstract Form element
*/
abstract public function getSettingField( ?Announcement $announcement ): FormAbstract;
}
@@ -0,0 +1,41 @@
<?php
/**
* @brief ApprovalReasonAbstract
* @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 07/23/2024
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\core\Approval;
use RuntimeException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class ApprovalReasonAbstract
{
/**
* Reason Key
*
* @return string
*/
abstract public function reasonKey(): string;
/**
* Parse Reason
*
* @param Approval $approval Approval row
* @return array<lang,sprintf>
*/
abstract public function parseReason( Approval $approval ): array;
}
+41
View File
@@ -0,0 +1,41 @@
<?php
/**
* @brief BuildAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use RuntimeException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class BuildAbstract
{
/**
* Build
*
* @return void
* @throws RuntimeException
*/
abstract public function build() : void;
/**
* Finish Build
*
* @return void
*/
abstract protected function finish() : void;
}
+43
View File
@@ -0,0 +1,43 @@
<?php
/**
* @brief BulkMailAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class BulkMailAbstract
{
/**
* Get tags that can be used in bulk mail
*
* @return array
*/
abstract public function getTags(): array;
/**
* Get value for tags
*
* @param string $content Bulk Mail Content (passed in case a particular tag is computationally expensive so that the extension may "sniff" for it and elect not to perform the computation if it is not used)
* @param int $type 0=All, 1=Global, 2=Member-specific
* @param NULL|Member $member Member object if $type is 0 or 2
* @return array
*/
abstract public function returnTagValues( string $content, int $type, ?Member $member ): array;
}
+36
View File
@@ -0,0 +1,36 @@
<?php
/**
* @brief ClubAbstract
* @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 08/04/2024
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member\Club;
use IPS\Node\Model;
use RuntimeException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class ClubAbstract
{
/**
* Tabs
*
* @param \IPS\Member\Club $club The club
* @param \IPS\Node\Model $container Container
* @return array
*/
abstract public function tabs( Club $club, ?Model $container = NULL ): array;
}
@@ -0,0 +1,62 @@
<?php
/**
* @brief CommunityEnhancementsAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use LogicException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class CommunityEnhancementsAbstract
{
/**
* @brief Enhancement is enabled?
*/
public bool $enabled = FALSE;
/**
* @brief IPS-provided enhancement?
*/
public bool $ips = FALSE;
/**
* @brief Enhancement has configuration options?
*/
public bool $hasOptions = TRUE;
/**
* @brief Icon data
*/
public string $icon = "";
/**
* Edit
*
* @return void
*/
abstract public function edit() : void;
/**
* Enable/Disable
*
* @param $enabled bool Enable/Disable
* @return void
* @throws LogicException
*/
abstract public function toggle( bool $enabled ) : void;
}
+54
View File
@@ -0,0 +1,54 @@
<?php
/**
* @brief ContactUsAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Helpers\Form;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class ContactUsAbstract
{
/**
* Process Form
*
* @param Form $form The form
* @param array $formFields Additional Configuration Formfields
* @param array $options Type Radio Form Options
* @param array $toggles Type Radio Form Toggles
* @param array $disabled Type Radio Form Disabled Options
* @return void
*/
abstract public function process( Form &$form, array &$formFields, array &$options, array &$toggles, array &$disabled ) : void;
/**
* Allows extensions to do something before the form is shown... e.g. add your own custom fields, or redirect the page
*
* @param Form $form The form
* @return void
*/
abstract public function runBeforeFormOutput( Form $form ) : void;
/**
* Handle the Form
*
* @param array $values Values from form
* @return bool
*/
abstract public function handleForm( array $values ) : bool;
}
@@ -0,0 +1,44 @@
<?php
/**
* @brief ContentRouterAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
use IPS\Member\Group;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class ContentRouterAbstract
{
/**
* @brief Content Item Classes
*/
public array $classes = array();
/**
* @brief Can be shown in similar content
*/
public bool $similarContent = FALSE;
/**
* Constructor
*
* @param Member|Group|null $member If checking access, the member/group to check for, or NULL to not check access
*/
abstract public function __construct( Member|Group $member = NULL );
}
+145
View File
@@ -0,0 +1,145 @@
<?php
/**
* @brief CustomFieldExtensionAbstract
* @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 4/11/2024
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\CustomField;
use IPS\Helpers\Form;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class CustomFieldAbstract
{
/**
* The value that will be used for the "field type"
* This must be unique
*
* @return string
*/
abstract public static function fieldType() : string;
/**
* Language string for the title of the field type.
* Will be displayed in the "Field Type" dropdown list when
* creating a custom field
*
* @return string
*/
abstract public static function fieldTypeTitle() : string;
/**
* The class that should be called to render the field
* in a form. This class should extend FormAbstract (or an existing field)
* @see CustomField::buildHelper()
*
* @return string
*/
abstract public static function formClass() : string;
/**
* Can be overridden by individual extension implementations
* to allow for a field to be available only in certain connditions
*
* @return bool
*/
public static function isEnabled() : bool
{
return true;
}
/**
* The database field type that will be used when adding a
* column to the database table
*
* @return string
*/
public static function columnDefinition() : string
{
return "TEXT";
}
/**
* Does the change mean wiping the value?
*
* @param CustomField $field
* @param string $newType The new type
* @return bool
*/
public static function canKeepValueOnChange( CustomField $field, string $newType ): bool
{
return $newType == $field->type;
}
/**
* A list of form elements that will be toggled on when this field
* type is selected
* @see CustomField::$additionalFieldToggles
*
* @return array
*/
public static function fieldTypeToggles() : array
{
return [];
}
/**
* Add fields to the field creation form
*
* @param Form $form
* @param CustomField $field The field currently being modified
* @return void
*/
public static function form( Form $form, CustomField $field ) : void
{
}
/**
* Process values from the ACP Custom Field form
*
* @param array $values
* @return array
*/
public static function formatFormValues( array $values ) : array
{
return $values;
}
/**
* Return any options that will be passed to the Form Element
*
* @param CustomField $field
* @return array
*/
public static function formHelperOptions( CustomField $field ) : array
{
return [];
}
/**
* Display Value
* @see CustomField::displayValue()
*
* @param CustomField $field
* @param mixed|null $value The value
* @param bool $showSensitiveInformation If TRUE, potentially sensitive data (like passwords) will be displayed - otherwise will be blanked out
* @param string|null $separator Used to separate items when displaying a field with multiple values.
* @return string|null
*/
abstract public static function displayValue( CustomField $field, mixed $value=NULL, bool $showSensitiveInformation=FALSE, string $separator=NULL ): ?string;
}
+60
View File
@@ -0,0 +1,60 @@
<?php
/**
* @brief DashboardAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use LogicException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class DashboardAbstract
{
/**
* Can the current user view this dashboard item?
*
* @return bool
*/
abstract public function canView(): bool;
/**
* Return the block HTML show on the dashboard
*
* @return string
*/
abstract public function getBlock(): string;
/**
* Return the block information
*
* @return array array( 'name' => 'Block title', 'key' => 'unique_key', 'size' => [1,2,3], 'by' => 'Author name' )
*/
public function getInfo(): array
{
return array();
}
/**
* Save the block data submitted. This method is only necessary if your block accepts some sort of submitted data to save (such as the 'admin notes' block).
*
* @return void
* @throws LogicException
*/
public function saveBlock()
{
}
}
@@ -0,0 +1,118 @@
<?php
/**
* @brief EditorLocationsAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Content;
use IPS\Helpers\Form\Editor;
use IPS\Http\Url;
use IPS\Member;
use IPS\Node\Model;
use LogicException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class EditorLocationsAbstract
{
/**
* Can we use attachments in this editor?
*
* @param Member $member The member
* @param Editor $field The editor field
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
*/
abstract public function canAttach( Member $member, Editor $field ): ?bool;
/**
* Permission check for attachments
*
* @param Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
* @return bool
*/
abstract public function attachmentPermissionCheck( Member $member, ?int $id1, ?int $id2, ?string $id3, array $attachment, bool $viewOnly=FALSE ): bool;
/**
* Attachment lookup
*
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @return Content|Member|Model|Url|null
* @throws LogicException
*/
abstract public function attachmentLookup( ?int $id1=NULL, ?int $id2=NULL, ?string $id3=NULL ): Model|Content|Url|Member|null;
/**
* Can whatever is posted in this editor be moderated?
* If this returns TRUE, we must ensure the content is ran through word, link and image filters
*
* @param Member $member The member
* @param Editor $field The editor field
* @return bool
*/
public function canBeModerated( Member $member, Editor $field ): bool
{
return FALSE;
}
/**
* Rebuild content post-upgrade
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
//public function rebuildContent( ?int $offset, ?int $max ): int
//{
//}
/**
* @brief Store lazy loading status ( true = enabled )
*/
protected ?bool $_lazyLoadStatus = null;
/**
* Rebuild content to add or remove lazy loading
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @param bool $status Enable/Disable lazy loading
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
//public function rebuildLazyLoad( ?int $offset, ?int $max, bool $status=TRUE ): int
//{
//}
/**
* Total content count to be used in progress indicator
*
* @return int Total Count
*/
//public function contentCount() : int
//{
// return \IPS\Db::i()->select( 'COUNT(*) as count', '...', "..." )->setKeyField('count')->first();
//}
}
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* @brief EditorMediaAbstract
* @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 11/16/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class EditorMediaAbstract
{
/**
* Get Counts
*
* @param Member $member The member
* @param string $postKey The post key
* @param string|null $search The search term (or NULL for all)
* @return array|int
*/
abstract public function count( Member $member, string $postKey, ?string $search=NULL ): array|int;
/**
* Get Files
*
* @param Member $member The member
* @param string|null $search The search term (or NULL for all)
* @param string $postKey The post key
* @param int $page Page
* @param int $limit Number to get
* @return array array( 'Title' => array( 'http://www.example.com/file1.txt' => \IPS\File, 'http://www.example.com/file2.txt' => \IPS\File, ... ), ... )
*/
abstract public function get( Member $member, ?string $search, string $postKey, int $page, int $limit ): array;
}
+60
View File
@@ -0,0 +1,60 @@
<?php
/**
* @brief FileStorageAbstract
* @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 11/17/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\File;
use UnderflowException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class FileStorageAbstract
{
/**
* Count stored files
*
* @return int
*/
abstract public function count(): int;
/**
* Move stored files
*
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
* @param int $storageConfiguration New storage configuration ID
* @param int|NULL $oldConfiguration Old storage configuration ID
* @throws UnderflowException When file record doesn't exist. Indicating there are no more files to move
* @return void
*/
abstract public function move( int $offset, int $storageConfiguration, int $oldConfiguration=NULL ) : void;
/**
* Check if a file is valid
*
* @param File|string $file The file path to check
* @return bool
*/
abstract public function isValidFile( File|string $file ): bool;
/**
* Delete all stored files
*
* @return void
*/
abstract public function delete() : void;
}
+55
View File
@@ -0,0 +1,55 @@
<?php
/**
* @brief FormsAbstract
* @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 1/18/2024
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Helpers\Form;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class FormsAbstract
{
/**
* Identifies the form that will be extended.
* Valid values: registration|checkout
* @see Form::availableForExtension()
* @return string
*/
abstract public static function formType() : string;
/**
* Return an array of fields that will be added to the form
* Additional parameters will be passed in depending on the form type
* registration: no additional parameters
* checkout: currently logged in member, current invoice
*
* @return array
*/
abstract public function formElements() : array;
/**
* Handle the field values on save
* Additional parameters will be passed in depending on the form type
* registration: newly created member
* checkout: currently logged in member, current invoice
*
* @param array $values
* @return void
*/
abstract public function processFormValues( array $values ) : void;
}
+56
View File
@@ -0,0 +1,56 @@
<?php
/**
* @brief GroupFormAbstract
* @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 11/17/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Helpers\Form;
use IPS\Member\Group;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class GroupFormAbstract
{
/**
* Process Form
*
* @param Form $form The form
* @param Group $group Existing Group
* @return void
*/
abstract public function process( Form $form, Group $group ) : void;
/**
* Save
*
* @param array $values Values from form
* @param Group $group The group
* @return void
*/
abstract public function save( array $values, Group $group ) : void;
/**
* Can this group be deleted?
*
* @param Group $group The group
* @return bool
*/
public function canDelete( Group $group ): bool
{
return TRUE;
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* @brief GroupLimitsAbstract
* @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 11/17/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class GroupLimitsAbstract
{
/**
* Get group limits by priority
*
* @return array
*/
abstract public function getLimits(): array;
}
+89
View File
@@ -0,0 +1,89 @@
<?php
/**
* @brief IpAddressesAbstract
* @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 11/17/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Db\Select;
use IPS\Http\Url;
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class IpAddressesAbstract
{
/**
* Supported in the ACP IP address lookup tool?
*
* @return bool
* @note If the method does not exist in an extension, the result is presumed to be TRUE
*/
public function supportedInAcp(): bool
{
return TRUE;
}
/**
* Supported in the ModCP IP address lookup tool?
*
* @return bool
* @note If the method does not exist in an extension, the result is presumed to be TRUE
*/
public function supportedInModCp(): bool
{
return TRUE;
}
/**
* Removes the logged IP address
*
* @param int $time
* @return void
*/
public function pruneIpAddresses( int $time ) : void
{
//
}
/**
* Find Records by IP
*
* @param string $ip The IP Address
* @param Url|null $baseUrl URL table will be displayed on or NULL to return a count
* @return string|int|null
*/
abstract public function findByIp( string $ip, ?Url $baseUrl = NULL ): string|int|null;
/**
* Find IPs by Member
*
* @code
return array(
'::1' => array(
'ip' => '::1'// string (IP Address)
'count' => ... // int (number of times this member has used this IP)
'first' => ... // int (timestamp of first use)
'last' => ... // int (timestamp of most recent use)
),
...
);
* @endcode
* @param Member $member The member
* @return array|Select
*/
abstract public function findByMember( Member $member ): array|Select;
}
+45
View File
@@ -0,0 +1,45 @@
<?php
/**
* @brief LiveSearchAbstract
* @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 11/17/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class LiveSearchAbstract
{
/**
* Get the search results
*
* @param string $searchTerm Search Term
* @return array Array of results
*/
abstract public function getResults( string $searchTerm ): array;
/**
* Check we have access
*
* @return bool
*/
abstract public function hasAccess(): bool;
/**
* Is default for current page?
*
* @return bool
*/
abstract public function isDefault(): bool;
}
+80
View File
@@ -0,0 +1,80 @@
<?php
/**
* @brief LoaderExtension
* @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 7/24/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Http\Url;
if (!defined('\IPS\SUITE_UNIQUE_KEY'))
{
header(($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0') . ' 403 Forbidden');
exit;
}
abstract class LoaderAbstract
{
/**
* Additional CSS files to load
*
* @return array<string|Url>
*/
public function css(): array
{
return [];
}
/**
* Additional JS files to load
*
* @return array<string|Url>
*/
public function js(): array
{
return [];
}
/**
* If a redirect is needed, return the URL
* or NULL to continue
*
* @return Url|null
*/
public function checkForRedirect() : Url|null
{
return null;
}
/**
* Show a custom error message or null to use the default
*
* @param string $message
* @param mixed $code
* @param int $httpStatusCode
* @return string|null
*/
public function customError( string $message, mixed $code, int $httpStatusCode ) : string|null
{
return null;
}
/**
* Run custom code right on Dispatcher::finish()
*
* @return void
*/
public function onFinish() : void
{
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* @brief MFAAreaAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class MFAAreaAbstract
{
/**
* Is this area available and should show in the ACP configuration?
*
* @return bool
*/
abstract public function isEnabled(): bool;
}
@@ -0,0 +1,34 @@
<?php
/**
* @brief MemberExportPiiAbstract
* @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 11/17/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class MemberExportPiiAbstract
{
/**
* Return data
* @param Member $member The member
*
* @return array
*/
abstract public function getData( Member $member ): array;
}
@@ -0,0 +1,88 @@
<?php
/**
* @brief MemberFilterAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Db\Select;
use IPS\Member;
use LogicException;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class MemberFilterAbstract
{
/**
* Determine if the filter is available in a given area
*
* @param string $area Area to check (bulkmail, group_promotions, automatic_moderation, passwordreset)
* @return bool
*/
abstract public function availableIn( string $area ): bool;
/**
* Get Setting Field
*
* @param array $criteria Value returned from the save() method
* @return array Array of form elements
*/
abstract public function getSettingField( array $criteria ): array;
/**
* Save the filter data
*
* @param array $post Form values
* @return array|bool False, or an array of data to use later when filtering the members
* @throws LogicException
*/
abstract public function save( array $post ) : array|bool;
/**
* Get where clause to add to the member retrieval database query
*
* @param array $data The array returned from the save() method
* @return array|NULL Where clause - must be a single array( "clause" )
*/
abstract public function getQueryWhereClause( array $data ): ?array;
/**
* Callback for member retrieval database query
* Can be used to set joins
*
* @param array $data The array returned from the save() method
* @param Select $query The query
* @return void
*/
public function queryCallback( array $data, Select $query ) : void
{
}
/**
* Determine if a member matches specified filters
*
* @note This is only necessary if availableIn() includes group_promotions
* @param Member $member Member object to check
* @param array $filters Previously defined filters
* @param object|NULL $object Calling class
* @return bool
*/
public function matches( Member $member, array $filters, ?object $object=NULL ): bool
{
return TRUE;
}
}
@@ -0,0 +1,48 @@
<?php
/**
* @brief MemberHistoryAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class MemberHistoryAbstract
{
/**
* Return the valid member history log types
*
* @return array
*/
abstract public function getTypes(): array;
/**
* Parse LogType column
*
* @param string $value column value
* @param array $row entire log row
* @return string
*/
abstract public function parseLogType( string $value, array $row ): string;
/**
* Parse LogData column
*
* @param string $value column value
* @param array $row entire log row
* @return string
*/
abstract public function parseLogData( string $value, array $row ): string;
}
+45
View File
@@ -0,0 +1,45 @@
<?php
/**
* @brief ModCpAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class ModCpAbstract
{
/**
* Returns the primary tab key for the navigation bar
*
* @return string|null
*/
abstract public function getTab() : ?string;
/**
* What do I manage?
* Acceptable responses are: content, members, or other
*
* @return string
*/
abstract public function manageType() : string;
/**
* Manage
*
* @return void
*/
abstract public function manage() : void;
}
@@ -0,0 +1,37 @@
<?php
/**
* @brief ModCpMemberManagementAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class ModCpMemberManagementAbstract
{
/**
* Returns the tab key for the navigation bar
*
* @return string|null
*/
abstract public function getTab() : ?string;
/**
* Get content to display
*
* @return string
*/
abstract public function manage() : string;
}
@@ -0,0 +1,127 @@
<?php
/**
* @brief Moderator Permissions 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
* @since 7 Sept 2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Moderator Permissions Extension
*/
abstract class ModeratorPermissionsAbstract
{
/**
* Get Permissions
*
* @code
* return array(
* 'key' => 'YesNo', // Can just return a string with type
* 'key' => array( // Or an array for more options
* 'YesNo', // Type
* array( ... ), // Options (as defined by type's class)
* 'prefix', // Prefix
* 'suffix', // Suffix
* ),
* ...
* );
* @endcode
* @param array $toggles
* @return array
*/
abstract public function getPermissions( array $toggles ): array;
/**
* Pre-save
*
* @note This can be used to adjust the values submitted on the form prior to saving
* @param array $values The submitted form values
* @return void
*/
public function preSave( array &$values ) : void
{
}
/**
* After change
*
* @param array $moderator The moderator
* @param array $changed Values that were changed
* @return void
*/
public function onChange( array $moderator, array $changed ) : void
{
}
/**
* After delete
*
* @param array $moderator The moderator
* @return void
*/
public function onDelete( array $moderator ) : void
{
}
/**
* Get Content Permission Permissions
*
* @param array $toggles Toggle data
* @code
return array(
'key' => 'YesNo', // Can just return a string with type
'key' => array( // Or an array for more options
'YesNo', // Type
array( ... ), // Options (as defined by type's class)
'prefix', // Prefix
'suffix', // Suffix
),
...
);
* @endcode
* @return array
*/
public function getContentPermissions( array $toggles ): array
{
return array();
}
/**
* After Content Permission change
*
* @param array $moderator The moderator
* @param array $changed Values that were changed
* @return void
*/
public function onContentChange( array $moderator, array $changed ) : void
{
}
/**
* After Content Permission change
*
* @param array $moderator The moderator
* @return void
*/
public function onContentDelete( array $moderator ) : void
{
}
}
@@ -0,0 +1,70 @@
<?php
/**
* @brief NotificationsAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class NotificationsAbstract
{
/**
* Get fields for configuration
*
* @param 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
*/
abstract public static function configurationOptions( ?Member $member = NULL ): array;
/**
* Save "extra" value
*
* @param 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( ?Member $member, string $key, bool $value ) : void
{
// You can perform extra processing here to save values in a specific manner if needed
}
/**
* Disable all "extra" values for a particular type
*
* @param 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( ?Member $member, string $method ) : void
{
// 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() : void
{
// 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
}
}
@@ -0,0 +1,37 @@
<?php
/**
* @brief OutputPluginsAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class OutputPluginsAbstract
{
/**
* @brief Can be used when compiling CSS
*/
public static bool $canBeUsedInCss = FALSE;
/**
* Run the plug-in
*
* @param string $data The initial data from the tag
* @param array $options Array of options
* @return array|string string with code to eval or array( 'pre' => Code to eval before 'return', 'return' => Code to eval to return desired value )
*/
abstract public static function runPlugin( string $data, array $options ): string|array;
}
@@ -0,0 +1,85 @@
<?php
/**
* @brief OverviewStatisticsAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use DateInterval;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class OverviewStatisticsAbstract
{
/**
* @brief Which statistics page (activity or user)
*/
public string $page = 'user';
/**
* Return the sub-block keys
*
* @note This is designed to allow one class to support multiple blocks, for instance using the ContentRouter to generate blocks.
* @return array
*/
abstract public function getBlocks(): array;
/**
* Return block details (title and description)
*
* @param string|NULL $subBlock The subblock we are loading as returned by getBlocks()
* @return array
*/
abstract public function getBlockDetails( ?string $subBlock = NULL ): array;
/**
* Return the block HTML to show
*
* @param array|string|null $dateRange String for a fixed time period in days, NULL for all time, or an array with 'start' and 'end' \IPS\DateTime objects to restrict to
* @param string|NULL $subBlock The subblock we are loading as returned by getBlocks()
* @return string
*/
abstract public function getBlock( array|string|null $dateRange = NULL, ?string $subBlock = NULL ): string;
/**
* Calculate interval for charts
*
* @param int|null $dateRange
* @return DateInterval|null
*/
protected static function getInterval( ?int $dateRange ) : ?DateInterval
{
switch( $dateRange )
{
case '7':
return new DateInterval( 'P7D' );
case '30':
return new DateInterval( 'P1M' );
case '90':
return new DateInterval( 'P3M' );
case '180':
return new DateInterval( 'P6M' );
case '365':
return new DateInterval( 'P1Y' );
}
return null;
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* @brief PermissionsAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class PermissionsAbstract
{
/**
* Get node classes
*
* @return array
*/
abstract public function getNodeClasses(): array;
}
+56
View File
@@ -0,0 +1,56 @@
<?php
/**
* @brief ProfileAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class ProfileAbstract
{
/**
* Member
*/
protected ?Member $member = null;
/**
* Constructor
*
* @param Member $member Member whose profile we are viewing
* @return void
*/
public function __construct( Member $member )
{
$this->member = $member;
}
/**
* Is there content to display?
*
* @return bool
*/
abstract public function showTab(): bool;
/**
* Display
*
* @return string
*/
abstract public function render(): string;
}
+140
View File
@@ -0,0 +1,140 @@
<?php
/**
* @brief ProfileStepsAbstract
* @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 11/20/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Helpers\Form;
use IPS\Http\Url;
use IPS\Member;
use IPS\Member\ProfileStep;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class ProfileStepsAbstract
{
/**
* Available Actions to complete steps
*
* @return array array( 'key' => 'lang_string' )
*/
abstract public static function actions(): array;
/**
* Available sub actions to complete steps
*
* @return array array( 'key' => 'lang_string' )
*/
abstract public static function subActions(): 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 Member|NULL $member The member to check, or NULL for currently logged in
* @return bool
*/
abstract public function completed( ProfileStep $step, ?Member $member = NULL ): bool;
/**
* 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();
}
/**
* Return all actions that can be reused
*
* @return array
*/
public static function allowMultiple() : array
{
return array();
}
/**
* Action URL
*
* @param string $action The action
* @param Member|NULL $member The member, or NULL for currently logged in
* @return Url|null
*/
public function url( string $action, ?Member $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 Member $member The member
* @param Form $form The form
* @return void
*/
public static function formatFormValues( array $values, Member $member, Form $form ) : void
{
}
/**
* Wizard Steps
*
* @param Member|null $member Member or NULL for currently logged in member
* @return array|string
*/
abstract public static function wizard( ?Member $member = NULL ): array|string;
/**
* Post Delete
*
* @param ProfileStep $step The step
* @return void
*/
public function onDelete( ProfileStep $step ) : void
{
}
}
+72
View File
@@ -0,0 +1,72 @@
<?php
/**
* @brief QueueAbstract
* @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 11/21/2023
*/
namespace IPS\Extensions;
use IPS\Task\Queue\OutOfRangeException as QueueOutOfRangeException;
use OutOfRangeException;
use const IPS\REBUILD_NORMAL;
/* 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;
}
abstract class QueueAbstract
{
/**
* @brief Number of content items to rebuild per cycle
*/
public int $rebuild = REBUILD_NORMAL;
/**
* Parse data before queuing
*
* @param array $data
* @return array|null
*/
abstract public function preQueueData( array $data ): ?array;
/**
* Run Background Task
*
* @param array $data Data as it was passed to \IPS\Task::queue()
* @param int $offset Offset
* @return int New offset
* @throws QueueOutOfRangeException Indicates offset doesn't exist and thus task is complete
*/
abstract public function run( array &$data, int $offset ): int;
/**
* Get Progress
*
* @param array $data Data as it was passed to \IPS\Task::queue()
* @param int $offset Offset
* @return array( 'text' => 'Doing something...', 'complete' => 50 ) Text explaining task and percentage complete
* @throws OutOfRangeException Indicates offset doesn't exist and thus task is complete
*/
abstract public function getProgress( array $data, int $offset ): array;
/**
* Perform post-completion processing
*
* @param array $data Data returned from preQueueData
* @param bool $processed Was anything processed or not? If preQueueData returns NULL, this will be FALSE.
* @return void
*/
public function postComplete( array $data, bool $processed = TRUE ) : void
{
}
}
+50
View File
@@ -0,0 +1,50 @@
<?php
/**
* @brief RssImportAbstract
* @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 11/21/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\core\Rss\Import;
use IPS\Helpers\Form;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class RssImportAbstract
{
/**
* @brief RSSImport Classes
*/
public array $classes = array();
/**
* Display Form
*
* @param Form $form The form
* @param Import|null $rss
* @return void
*/
abstract public function form( Form $form, ?Import $rss=null ) : void;
/**
* Save
*
* @param array $values Values from form
* @param Import $rss
* @return array
*/
abstract public function saveForm( array &$values, Import $rss ) : array;
}
+107
View File
@@ -0,0 +1,107 @@
<?php
/**
* @brief SsoAbstract
* @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 2/2/2024
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Http\Url;
use IPS\Session\Front;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class SSOAbstract
{
/**
* Determine if the extension is currently enabled
*
* @return bool
*/
public function isEnabled(): bool
{
return true;
}
/**
* Returns an array of setting keys that will be overridden by this extension
* Example: post_before_registering might always return a value of 0
* Would return an array like [ 'post_before_registering' => 0 ]
*
* @return array
*/
public function overrideSettings(): array
{
return [];
}
/**
* Return URL guest should be redirected to for login
*
* @return Url|null
*/
public function loginUrl(): Url|null
{
return NULL;
}
/**
* URL user should be redirected on logout.
*
* @param Url $redirectUrl
* @return Url|null
*/
public function logoutUrl( Url $redirectUrl ): Url|null
{
return NULL;
}
/**
* Return URL user should visit to change display name
*
* @return Url|null
*/
public function displayNameChange(): Url|null
{
return NULL;
}
/**
* Custom logic executed on session init
*
* @param Front $session
* @return void
*/
abstract public function onSessionInit( Front $session ): void;
/**
* Custom logic executed on session read
*
* @param Front $session
* @param string $result Initial result from the Session::read method
* @return string
*/
abstract public function onSessionRead( Front $session, string $result ): string;
/**
* Does SSO support login as?
*
* @return bool
*/
public function supportsLoginAs(): bool
{
return FALSE;
}
}
+62
View File
@@ -0,0 +1,62 @@
<?php
/**
* @brief SitemapAbstract
* @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 11/21/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Sitemap;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class SitemapAbstract
{
/**
* @brief Recommended Settings
*/
public array $recommendedSettings = array();
/**
* Add settings for ACP configuration to the form
*
* @return array
*/
abstract public function settings(): array;
/**
* Save settings for ACP configuration
*
* @param array $values Values
* @return void
*/
abstract public function saveSettings( array $values ) : void;
/**
* Get the sitemap filename(s)
*
* @return array
*/
abstract public function getFilenames(): array;
/**
* Generate the sitemap
*
* @param string $filename The sitemap file to build (should be one returned from getFilenames())
* @param Sitemap $sitemap Sitemap object reference
* @return int|null
*/
abstract public function generateSitemap( string $filename, Sitemap $sitemap ) : ?int;
}
+36
View File
@@ -0,0 +1,36 @@
<?php
/**
* @brief StreamItemsAbstract
* @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 11/21/2023
*/
namespace IPS\Extensions;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Member;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
abstract class StreamItemsAbstract
{
/**
* Is there content to display?
*
* @param Member|NULL $author The author to limit extra items to
* @param int|NULL $lastTime If provided, only items since this date are included. If NULL, it works out which to include based on what results are being shown
* @param int|NULL $firstTime If provided, only items before this date are included. If NULL, it works out which to include based on what results are being shown
* @return array Array of \IPS\Content\Search\Result\Custom objects
*/
abstract public function extraItems( ?Member $author=NULL, ?int $lastTime=NULL, ?int $firstTime=NULL ): array;
}
+53
View File
@@ -0,0 +1,53 @@
<?php
/**
* @brief UninstallAbstract
* @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 11/21/2023
*/
namespace IPS\Extensions;
/* 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;
}
abstract class UninstallAbstract
{
/**
* Code to execute before the application has been uninstalled
*
* @param string $application Application directory
* @return void
*/
public function preUninstall( string $application ) : void
{
}
/**
* Code to execute after the application has been uninstalled
*
* @param string $application Application directory
* @return void
*/
public function postUninstall( string $application ) : void
{
}
/**
* Code to execute when other applications or plugins are uninstalled
*
* @param string $application Application directory
* @return void
*/
public function onOtherUninstall( string $application ) : void
{
}
}