Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,48 +11,55 @@
|
||||
namespace IPS\Content;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Content;
|
||||
use IPS\Dispatcher;
|
||||
use IPS\Lang;
|
||||
use IPS\Member;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Content Extension Generator
|
||||
*/
|
||||
abstract class _ExtensionGenerator
|
||||
abstract class ExtensionGenerator
|
||||
{
|
||||
/**
|
||||
* @brief If TRUE, will prevent comment classes being included
|
||||
*/
|
||||
protected static $contentItemsOnly = FALSE;
|
||||
protected static bool $contentItemsOnly = FALSE;
|
||||
|
||||
/**
|
||||
* @brief If TRUE, will include archive classes
|
||||
*/
|
||||
protected static $includeArchive = FALSE;
|
||||
protected static bool $includeArchive = FALSE;
|
||||
|
||||
/**
|
||||
* Generate Extensions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function generate()
|
||||
public static function generate(): array
|
||||
{
|
||||
$return = array();
|
||||
|
||||
foreach ( \IPS\Content::routedClasses( FALSE, static::$includeArchive, static::$contentItemsOnly ) as $_class )
|
||||
foreach ( Content::routedClasses( FALSE, static::$includeArchive, static::$contentItemsOnly ) as $_class )
|
||||
{
|
||||
$obj = new static;
|
||||
$obj->class = $_class;
|
||||
|
||||
if ( \IPS\Dispatcher::hasInstance() )
|
||||
if ( Dispatcher::hasInstance() )
|
||||
{
|
||||
$language = \IPS\Member::loggedIn()->language();
|
||||
$language = Member::loggedIn()->language();
|
||||
}
|
||||
else
|
||||
{
|
||||
$language = \IPS\Lang::load( \IPS\Lang::defaultLanguage() );
|
||||
$language = Lang::load( Lang::defaultLanguage() );
|
||||
}
|
||||
|
||||
$language->words[ 'ipAddresses__core_Content_' . str_replace( '\\', '_', mb_substr( $_class, 4 ) ) ] = $language->addToStack( ( ( isset( $_class::$archiveTitle ) ) ? $_class::$archiveTitle : $_class::$title ) . '_pl', FALSE );
|
||||
@@ -65,5 +72,5 @@ abstract class _ExtensionGenerator
|
||||
/**
|
||||
* @brief Content Class
|
||||
*/
|
||||
public $class;
|
||||
public string $class;
|
||||
}
|
||||
Reference in new issue
Block a user