Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+13 -6
View File
@@ -12,7 +12,7 @@
namespace IPS\cms\Fields;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -32,17 +32,23 @@ class _Youtube extends \IPS\Helpers\Form\Text
/**
* Constructor
* Sets that the field is required if there is a minimum length and vice-versa
*
* @see \IPS\Helpers\Form\Abstract::__construct
* @param string $name Name
* @param mixed $defaultValue Default value
* @param bool|NULL $required Required? (NULL for not required, but appears to be so)
* @param array $options Type-specific options
* @param callback $customValidationCode Custom validation code
* @param string $prefix HTML to show before input field
* @param string $suffix HTML to show after input field
* @param string $id The ID to add to the row
* @return void
*/
public function __construct()
public function __construct( $name, $defaultValue=NULL, $required=FALSE, $options=array(), $customValidationCode=NULL, $prefix=NULL, $suffix=NULL, $id=NULL )
{
$this->childDefaultOptions['placeholder'] = \IPS\Member::loggedIn()->language()->addToStack('field_placeholder_youtube');
/* Call parent constructor */
call_user_func_array( 'parent::__construct', func_get_args() );
parent::__construct( $name, $defaultValue, $required, $options, $customValidationCode, $prefix, $suffix, $id );
$this->formType = 'text';
}
@@ -85,7 +91,8 @@ class _Youtube extends \IPS\Helpers\Form\Text
if ( ! isset( $params['height'] ) )
{
$params['height'] = 390;
/* Videos on Youtube are in a 16:9 resolution ratio, but we need to give some extra space hence the 30px addition */
$params['height'] = ( $params['width'] * ( 9 / 16 ) ) + 30;
}
$url = \IPS\Http\Url::external( $url )->setQueryString( $params );