Files
IPB/applications/core/widgets/communityhive.php
T
2025-12-19 16:14:56 -08:00

90 lines
1.6 KiB
PHP

<?php
/**
* @brief communityhive Widget
* @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 21 Aug 2023
*/
namespace IPS\core\widgets;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
use IPS\Settings;
/**
* communityhive Widget
*/
class _communityhive extends \IPS\Widget
{
/**
* @brief Widget Key
*/
public $key = 'communityhive';
/**
* @brief App
*/
public $app = 'core';
/**
* @brief Plugin
*/
public $plugin = '';
/**
* Initialise this widget
*
* @return void
*/
public function init()
{
parent::init();
}
/**
* Specify widget configuration
*
* @param null|\IPS\Helpers\Form $form Form object
* @return null|\IPS\Helpers\Form
*/
public function configuration( &$form=null )
{
$form = parent::configuration( $form );
return $form;
}
/**
* Ran before saving widget configuration
*
* @param array $values Values from form
* @return array
*/
public function preConfig( $values )
{
return $values;
}
/**
* Render a widget
*
* @return string
*/
public function render()
{
if ( Settings::i()->hive_enabled AND \IPS\core\Hive::showPromotion() )
{
return $this->output();
}
return '';
}
}