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,41 +11,46 @@
|
||||
namespace IPS\core\widgets;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Http\Url;
|
||||
use IPS\Member;
|
||||
use IPS\Settings;
|
||||
use IPS\Theme;
|
||||
use IPS\Widget;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* invite Widget
|
||||
*/
|
||||
class _invite extends \IPS\Widget
|
||||
class invite extends Widget
|
||||
{
|
||||
/**
|
||||
* @brief Widget Key
|
||||
*/
|
||||
public $key = 'invite';
|
||||
public string $key = 'invite';
|
||||
|
||||
/**
|
||||
* @brief App
|
||||
*/
|
||||
public $app = 'core';
|
||||
public string $app = 'core';
|
||||
|
||||
/**
|
||||
* @brief Plugin
|
||||
*/
|
||||
public $plugin = '';
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this widget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
public function init(): void
|
||||
{
|
||||
// Use this to perform any set up and to assign a template that is not in the following format:
|
||||
$this->template( array( \IPS\Theme::i()->getTemplate( 'widgets', $this->app, 'front' ), $this->key ) );
|
||||
$this->template( array( Theme::i()->getTemplate( 'widgets', $this->app, 'front' ), $this->key ) );
|
||||
|
||||
parent::init();
|
||||
}
|
||||
@@ -56,7 +61,7 @@ class _invite extends \IPS\Widget
|
||||
* @param array $values Values from form
|
||||
* @return array
|
||||
*/
|
||||
public function preConfig( $values )
|
||||
public function preConfig( array $values ): array
|
||||
{
|
||||
return $values;
|
||||
}
|
||||
@@ -66,14 +71,14 @@ class _invite extends \IPS\Widget
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
public function render(): string
|
||||
{
|
||||
$subject = \IPS\Member::loggedIn()->language()->addToStack('block_invite_subject', FALSE, array( 'sprintf' => array( \IPS\Settings::i()->board_name ), 'rawurlencode' => TRUE ) );
|
||||
$url = \IPS\Http\Url::internal( "" );
|
||||
$subject = Member::loggedIn()->language()->addToStack('block_invite_subject', FALSE, array( 'sprintf' => array( Settings::i()->board_name ), 'rawurlencode' => TRUE ) );
|
||||
$url = Url::internal( "" );
|
||||
|
||||
if( \IPS\Settings::i()->ref_on and \IPS\Member::loggedIn()->member_id )
|
||||
if( Settings::i()->ref_on and Member::loggedIn()->member_id )
|
||||
{
|
||||
$url = $url->setQueryString( array( '_rid' => \IPS\Member::loggedIn()->member_id ) );
|
||||
$url = $url->setQueryString( array( '_rid' => Member::loggedIn()->member_id ) );
|
||||
}
|
||||
|
||||
return $this->output( $subject, urlencode( $url ) );
|
||||
|
||||
Reference in new issue
Block a user