Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -36,4 +36,17 @@ abstract class AnnouncementsAbstract
|
||||
* @return FormAbstract Form element
|
||||
*/
|
||||
abstract public function getSettingField( ?Announcement $announcement ): FormAbstract;
|
||||
|
||||
/**
|
||||
* Parse the stored IDs into something that makes sense for the Announcement
|
||||
* Default is a comma-separated string, but some locations may override
|
||||
*
|
||||
* @see Announcement::loadAllByLocation()
|
||||
* @param string $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getAnnouncementIds( string $ids ) : array
|
||||
{
|
||||
return explode( ",", $ids );
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,10 @@ namespace IPS\Extensions;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\Helpers\Badge;
|
||||
use IPS\Helpers\Menu\Buttons;
|
||||
use IPS\Helpers\Menu\MenuItem;
|
||||
use IPS\Member;
|
||||
use IPS\Member\Club;
|
||||
use IPS\Member\Club\Page as ClubPage;
|
||||
use IPS\Node\Model;
|
||||
@@ -32,10 +34,10 @@ abstract class ClubAbstract
|
||||
* Tabs
|
||||
*
|
||||
* @param Club $club The club
|
||||
* @param Model|null $container Container
|
||||
* @param Model|ClubPage|null $container Container
|
||||
* @return array
|
||||
*/
|
||||
public function tabs( Club $club, ?Model $container = NULL ): array
|
||||
public function tabs( Club $club, Model|ClubPage|null $container = NULL ): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
@@ -65,4 +67,51 @@ abstract class ClubAbstract
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of badges to show on the club card and header
|
||||
*
|
||||
* @param Club $club
|
||||
* @return array<Badge>
|
||||
*/
|
||||
public function badges( Club $club ) : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/***
|
||||
* Return an array of form fields that will be added to the club creation form
|
||||
*
|
||||
* @param Club|null $club
|
||||
* @return array
|
||||
*/
|
||||
public function formElements( ?Club $club ) : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any custom fields that were added in the formElements method
|
||||
* This is executed after the club has been saved
|
||||
*
|
||||
* @param Club $club
|
||||
* @param array $values
|
||||
* @param bool $new
|
||||
* @return void
|
||||
*/
|
||||
public function saveForm( Club $club, array $values, bool $new=false ) : void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom filters for retrieving a list of clubs that are visible to a member
|
||||
*
|
||||
* @param Member|null $member
|
||||
* @return array
|
||||
*/
|
||||
public function clubsWhere( ?Member $member ) : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @brief MemberManagementAbstract
|
||||
* @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 10/10/2025
|
||||
*/
|
||||
|
||||
namespace IPS\Extensions;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use Callback;
|
||||
use IPS\Helpers\Table\Db as TableDb;
|
||||
use IPS\Helpers\Table\Table;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
abstract class MemberACPManagementAbstract
|
||||
{
|
||||
/**
|
||||
* Additional columns allowed in the member export.
|
||||
* Return an array where the key is the column name
|
||||
* and the value is a language string
|
||||
*
|
||||
* @return array<string,string>
|
||||
*/
|
||||
public function exportColumns() : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom formatting for any columns defined in exportColumns
|
||||
*
|
||||
* @param string $column
|
||||
* @param array $member
|
||||
* @return string
|
||||
*/
|
||||
public function exportColumnValue( string $column, array $member ) : string
|
||||
{
|
||||
return $member[ $column ] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional columns to show in the ACP member list
|
||||
* Return an array where the key is the column name
|
||||
* and the value is an optional callback method for @see Table::$parsers
|
||||
*
|
||||
* @return array<string,?Callback>
|
||||
*/
|
||||
public function acpColumns() : array
|
||||
{
|
||||
/* Example:
|
||||
return array(
|
||||
'column1' => null,
|
||||
'column2' => function( $val, $row )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
);*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional tables to join on the ACP member list
|
||||
* Format should match @see TableDb::$joins
|
||||
* @note If you are including a column in acpColumns(), make sure
|
||||
* you add it to the 'select' element of your join clause
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function acpJoins() : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -82,4 +82,17 @@ abstract class OverviewStatisticsAbstract
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: this method must be overridden in extension instances. Returning an empty array will exclude this block from the CSV download.
|
||||
*
|
||||
* @param null|array|string $dateRange=null
|
||||
* @param null|string $subBlock=null
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getBlockNumbers( array|string $dateRange = null, string $subBlock = null ) : array|null
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,12 @@
|
||||
namespace IPS\Extensions;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\Content\Item;
|
||||
use IPS\Content\Permissions;
|
||||
use IPS\Member;
|
||||
use IPS\Node\Model;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
@@ -26,5 +32,59 @@ abstract class PermissionsAbstract
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract public function getNodeClasses(): array;
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Override individual permissions for specific items
|
||||
* Return one of @see Permissions::PERM_ALLOW, Permissions::PERM_DENY, Permissions::PERM_DEFAULT
|
||||
* PERM_DEFAULT will essentially do nothing and default to the standard permission checks.
|
||||
* PERM_ALLOW and PERM_DENY will force an override.
|
||||
*
|
||||
* @note Check the object class before executing your custom logic.
|
||||
* You MUST return PERM_DEFAULT for any object that you are not checking.
|
||||
*
|
||||
* @param string $permission
|
||||
* @param object $object
|
||||
* @param Member|null $member
|
||||
* @return int
|
||||
*/
|
||||
public function checkPermission( string $permission, object $object, ?Member $member=null ) : int
|
||||
{
|
||||
return Permissions::PERM_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of node IDs with the permission equivalent of @see Permissions::PERM_ALLOW
|
||||
* Used in queries that retrieve nodes and/or items.
|
||||
*
|
||||
* @see Model::nodesWithPermission()
|
||||
* @see Item::getItemsWithPermission()
|
||||
* @param string $permission
|
||||
* @param string $class
|
||||
* @param Member|null $member
|
||||
* @return array
|
||||
*/
|
||||
public function nodeIdsToAllow( string $permission, string $class, ?Member $member=null ) : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of node IDs with the permission equivalent of @see Permissions::PERM_DENY
|
||||
* Used in queries that retrieve nodes and/or items.
|
||||
*
|
||||
* @see Model::nodesWithPermission()
|
||||
* @see Item::getItemsWithPermission()
|
||||
* @param string $permission
|
||||
* @param string $class
|
||||
* @param Member|null $member
|
||||
* @return array
|
||||
*/
|
||||
public function nodeIdsToDeny( string $permission, string $class, ?Member $member=null ) : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,10 @@ namespace IPS\Extensions;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\Content;
|
||||
use IPS\core\Rss\Import;
|
||||
use IPS\Helpers\Form;
|
||||
use IPS\Node\Model;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
@@ -30,6 +32,39 @@ abstract class RssImportAbstract
|
||||
*/
|
||||
public array $classes = array();
|
||||
|
||||
/**
|
||||
* @brief FileStorage extension to use
|
||||
*/
|
||||
public string $fileStorage = '';
|
||||
|
||||
/**
|
||||
* Show in the Admin CP?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function showInAdminCp(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return available options for a Form\Select
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function availableOptions(): array
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Node selector options
|
||||
*
|
||||
* @param Import|null $rss Existing RSS object if editing|null if not
|
||||
* @return array
|
||||
*/
|
||||
abstract public function nodeSelectorOptions( ?Import $rss ): array;
|
||||
|
||||
/**
|
||||
* Display Form
|
||||
*
|
||||
@@ -47,4 +82,13 @@ abstract class RssImportAbstract
|
||||
* @return array
|
||||
*/
|
||||
abstract public function saveForm( array &$values, Import $rss ) : array;
|
||||
|
||||
/**
|
||||
* @param Import $rss RSS object
|
||||
* @param array $article RSS feed article importing
|
||||
* @param Model $container Container object
|
||||
* @param string $content Post content with read more link if set
|
||||
* @return Content|null
|
||||
*/
|
||||
abstract public function create( Import $rss, array $article, Model $container, string $content ): ?Content;
|
||||
}
|
||||
Reference in new issue
Block a user