Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -56,7 +56,12 @@ abstract class _Dynamic extends \IPS\Helpers\Chart
|
||||
* @brief Title
|
||||
*/
|
||||
public $title;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Description
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @brief Google Chart Options
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ abstract class _Controller extends \IPS\Dispatcher\Controller
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'coverPhoto' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'cover_photo', NULL, TRUE, array( 'image' => TRUE, 'allowStockPhotos' => TRUE, 'minimize' => FALSE, 'maxFileSize' => ( $photo->maxSize and $photo->maxSize != -1 ) ? $photo->maxSize / 1024 : NULL, 'storageExtension' => $this->_coverPhotoStorageExtension() ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'cover_photo', NULL, TRUE, array( 'image' => [ 'maxWidth' => NULL, 'maxHeight' => NULL ], 'allowStockPhotos' => TRUE, 'minimize' => FALSE, 'maxFileSize' => ( $photo->maxSize and $photo->maxSize != -1 ) ? $photo->maxSize / 1024 : NULL, 'storageExtension' => $this->_coverPhotoStorageExtension() ) ) );
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
try
|
||||
|
||||
@@ -39,19 +39,8 @@ class _Hcaptcha implements CaptchaInterface
|
||||
*/
|
||||
public function getHtml()
|
||||
{
|
||||
\IPS\Output::i()->jsFilesAsync[] = "https://js.hcaptcha.com/1/api.js?hl=" . \IPS\Member::loggedIn()->language()->short ;
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->hCaptcha( \IPS\Settings::i()->hcaptcha_sitekey, preg_replace( '/^(.+?)\..*$/', '$1', \IPS\Member::loggedIn()->language()->short ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function rowHtml()
|
||||
{
|
||||
\IPS\Output::i()->jsFilesAsync[] = "https://js.hcaptcha.com/1/api.js?hl=" . \IPS\Member::loggedIn()->language()->short ;
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->hCaptcha( \IPS\Settings::i()->hcaptcha_sitekey, preg_replace( '/^(.+?)\..*$/', '$1', \IPS\Member::loggedIn()->language()->short ) );
|
||||
\IPS\Output::i()->jsFilesAsync[] = "https://js.hcaptcha.com/1/api.js";
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->hCaptcha( \IPS\Settings::i()->hcaptcha_sitekey );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,6 +46,8 @@ class _Editor extends FormAbstract
|
||||
'maxLength' => FALSE, // The maximum length. Note that the content is HTML, so this isn't the maximum number of visible characters, so should only be used for database limits. The database's max allowed packet will override if smaller
|
||||
'editorId' => NULL, // Passed to editorAttachments. Only necessary if the name may be changed
|
||||
'allowAttachments => TRUE, // Should the editor show upload options?
|
||||
'contentClass' => NULL, // If set to a string, will check this class for prioritizing mentions to participants.
|
||||
'contentId' => NULL, // If set, will check this particular item ID for prioritizing mentions to participants.
|
||||
);
|
||||
* @endcode
|
||||
*/
|
||||
@@ -68,6 +70,8 @@ class _Editor extends FormAbstract
|
||||
'allowAttachments' => TRUE,
|
||||
'ipsPlugins' => "ipsautolink,ipsautosave,ipsctrlenter,ipscode,ipscontextmenu,ipsemoticon,ipsimage,ipslink,ipsmentions,ipspage,ipspaste,ipsquote,ipsspoiler,ipsautogrow,ipssource,removeformat",
|
||||
'profanityBlock' => TRUE,
|
||||
'contentClass' => NULL,
|
||||
'contentId' => NULL
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -356,7 +360,7 @@ class _Editor extends FormAbstract
|
||||
|
||||
/* Display */
|
||||
$template = $raw ? 'editorRaw' : 'editor';
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->$template( $this->name, $value, $this->options, $allowed, md5( $this->options['autoSaveKey'] . ':' . session_id() ), $attachmentArea, json_encode( array() ), $this->options['tags'] );
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->$template( $this->name, $value, $this->options, $allowed, md5( $this->options['autoSaveKey'] . ':' . session_id() ), $attachmentArea, json_encode( array() ), $this->options['tags'], $this->options['contentClass'], $this->options['contentId'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -463,7 +467,7 @@ class _Editor extends FormAbstract
|
||||
|
||||
$altText = NULL;
|
||||
|
||||
if ( ! empty( $attachment['attach_labels'] ) )
|
||||
if ( \IPS\Settings::i()->ips_imagescanner_enable_discovery and ! empty( $attachment['attach_labels'] ) )
|
||||
{
|
||||
if ( $this->_altLabelWord === NULL )
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ class _Number extends FormAbstract
|
||||
/* Display */
|
||||
if ( ! isset( static::$generatedHtml[ $this->_name ] ) )
|
||||
{
|
||||
static::$generatedHtml[ $this->_name ] = \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->number( $this->name, $this->value, $this->required, $this->options['unlimited'], $this->options['range'], $this->options['min'], $this->options['max'], $this->options['step'], $this->options['decimals'], $this->options['unlimitedLang'], $this->options['disabled'], $this->suffix, $this->options['unlimitedToggles'], $this->options['unlimitedToggleOn'], $this->options['valueToggles'] );
|
||||
static::$generatedHtml[ $this->_name ] = \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->number( $this->name, $this->value, $this->required, $this->options['unlimited'], $this->options['range'], $this->options['min'], $this->options['max'], $this->options['step'], $this->options['decimals'], $this->options['unlimitedLang'], $this->options['disabled'], $this->suffix, $this->options['unlimitedToggles'], $this->options['unlimitedToggleOn'], $this->options['valueToggles'], NULL, $this->prefix );
|
||||
}
|
||||
|
||||
/* Because we mess around with suffixes in the Number field, we store the HTML here otherwise when it is regenerated, the suffix is missing */
|
||||
|
||||
@@ -246,7 +246,7 @@ class _Text extends TextArea
|
||||
}
|
||||
$return['prefix'] = \IPS\Request::i()->$freechoicePrefix;
|
||||
}
|
||||
elseif ( isset( \IPS\Request::i()->$firstAsPrefix ) and \IPS\Request::i()->$firstAsPrefix )
|
||||
elseif ( isset( \IPS\Request::i()->$firstAsPrefix ) and \IPS\Request::i()->$firstAsPrefix and !empty( $return ) )
|
||||
{
|
||||
$return = array_merge( array( 'prefix' => array_shift( $return ) ), $return );
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class _Upload extends FormAbstract
|
||||
/* If this has to be an image, set the allowed file types */
|
||||
if ( isset( $options['image'] ) and !isset( $options['image']['optional'] ) and !isset( $options['allowedFileTypes'] ) )
|
||||
{
|
||||
$options['allowedFileTypes'] = \IPS\Image::$imageExtensions;
|
||||
$options['allowedFileTypes'] = \IPS\Image::supportedExtensions();
|
||||
}
|
||||
|
||||
/* Call parent constructor */
|
||||
@@ -707,7 +707,7 @@ class _Upload extends FormAbstract
|
||||
$ext = mb_strtolower( mb_substr( $file['name'], ( mb_strrpos( $file['name'], '.' ) + 1 ) ) );
|
||||
|
||||
/* Don't allow "XSS" in images */
|
||||
if( \in_array( $ext, \IPS\File::$safeFileExtensions ) AND \in_array( $ext, \IPS\Image::$imageExtensions ) )
|
||||
if( \in_array( $ext, \IPS\File::$safeFileExtensions ) AND \in_array( $ext, \IPS\Image::supportedExtensions() ) )
|
||||
{
|
||||
if( \IPS\File::checkXssInFile( file_get_contents( $file['tmp_name'] ) ) )
|
||||
{
|
||||
@@ -731,7 +731,7 @@ class _Upload extends FormAbstract
|
||||
$ext = mb_strtolower( mb_substr( $filename, mb_strrpos( $filename, '.' ) + 1 ) );
|
||||
|
||||
/* Do image-specific stuff */
|
||||
if ( \in_array( $ext, \IPS\Image::$imageExtensions ) )
|
||||
if ( \in_array( $ext, \IPS\Image::supportedExtensions() ) )
|
||||
{
|
||||
/* Resize */
|
||||
$image = NULL;
|
||||
|
||||
@@ -765,14 +765,15 @@ class _Content extends Table
|
||||
if( \in_array( \IPS\Request::i()->modaction, array( 'hide', 'move', 'merge' ) ) )
|
||||
{
|
||||
$options = array();
|
||||
$ids = array_keys( \IPS\Request::i()->moderate );
|
||||
foreach ( $ids as $id )
|
||||
$ids = array();
|
||||
foreach ( \IPS\Request::i()->moderate as $id => $empty )
|
||||
{
|
||||
$item = $class::load( $id );
|
||||
|
||||
$action = 'can' . ucwords( \IPS\Request::i()->modaction );
|
||||
if( $item->$action() )
|
||||
{
|
||||
$ids[] = $id;
|
||||
$options[ $id ] = $item->mapped('title');
|
||||
$descriptions[ $id ] = \IPS\Member::loggedIn()->language()->addToStack( 'byline_merge', FALSE, array( 'htmlsprintf' => array( $item->author()->name, \IPS\DateTime::ts( $item->mapped('date') )->html() ) ) );
|
||||
}
|
||||
@@ -879,7 +880,11 @@ class _Content extends Table
|
||||
{
|
||||
if ( $id != $values['merge_master'] )
|
||||
{
|
||||
$otherItems[] = $class::load( $id );
|
||||
$otherItem = $class::load( $id );
|
||||
if( $otherItem->canMerge() )
|
||||
{
|
||||
$otherItems[] = $otherItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,16 +954,8 @@ class _Content extends Table
|
||||
/* Now update the containers in one go */
|
||||
foreach( $containers as $container )
|
||||
{
|
||||
if ( $container->_comments !== NULL )
|
||||
{
|
||||
$container->setLastComment();
|
||||
}
|
||||
|
||||
if ( $container->_reviews !== NULL )
|
||||
{
|
||||
$container->setLastReview();
|
||||
}
|
||||
|
||||
$container->setLastComment();
|
||||
$container->setLastReview();
|
||||
$container->resetCommentCounts();
|
||||
$container->save();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user