Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -34,4 +34,30 @@ class _Gallery extends \IPS\gallery\extensions\core\EditorLocations\Images
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can whatever is posted in this editor be moderated?
|
||||
* If this returns TRUE, we must ensure the content is ran through word, link and image filters
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param \IPS\Helpers\Form\Editor $field The editor field
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeModerated( $member, $field )
|
||||
{
|
||||
/* Image comments/reviews */
|
||||
if ( preg_match( '/^(?:editComment|reply|review)\-gallery\/gallery\-\d+/', $field->options['autoSaveKey'] ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
/* Unknown */
|
||||
else
|
||||
{
|
||||
if ( \IPS\IN_DEV )
|
||||
{
|
||||
throw new \RuntimeException( 'Unknown canBeModerated: ' . $field->options['autoSaveKey'] );
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,23 @@ class _Images
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can whatever is posted in this editor be moderated?
|
||||
* If this returns TRUE, we must ensure the content is ran through word, link and image filters
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param \IPS\Helpers\Form\Editor $field The editor field
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeModerated( $member, $field )
|
||||
{
|
||||
if ( \IPS\IN_DEV )
|
||||
{
|
||||
throw new \RuntimeException( 'Unknown canBeModerated: ' . $field->options['autoSaveKey'] );
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permission check for attachments
|
||||
|
||||
@@ -79,14 +79,15 @@ class _Gallery extends \IPS\core\MemberACPProfile\Restriction
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get details of a change to show on history
|
||||
*
|
||||
* @param array $changes Changes as set in save()
|
||||
* @param array $row Row of data from member history table.
|
||||
* @return array
|
||||
*/
|
||||
public static function changesForHistory( $changes )
|
||||
public static function changesForHistory( array $changes, array $row ): array
|
||||
{
|
||||
$return = array();
|
||||
|
||||
|
||||
@@ -77,8 +77,11 @@ class _RebuildGalleryImages
|
||||
{
|
||||
try
|
||||
{
|
||||
$image->deleteThumbnails();
|
||||
$image->buildThumbnails();
|
||||
/* Make sure the original image exists and has content */
|
||||
$file = \IPS\File::get( 'gallery_Images', $image->original_file_name );
|
||||
$file->contents();
|
||||
|
||||
$image->buildThumbnails( $file );
|
||||
$image->save();
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
@@ -151,14 +151,8 @@ class _Images
|
||||
/* Image sitemap data */
|
||||
$data['image:image'] = array(
|
||||
'image:loc' => (string) \IPS\File::get( 'gallery_Images', $item->masked_file_name )->url->setScheme( ( mb_substr( \IPS\Settings::i()->base_url, 0, 5 ) === 'https' ) ? 'https' : 'http' ),
|
||||
'image:caption' => $item->mapped('title'),
|
||||
'image:title' => $item->mapped('title')
|
||||
);
|
||||
|
||||
if( \IPS\GeoLocation::enabled() AND $item->gps_show )
|
||||
{
|
||||
$data['image:image']['image:geo_location'] = $item->loc_short;
|
||||
}
|
||||
|
||||
$priority = ( $item->sitemapPriority() ?: ( \intval( isset( $settings["sitemap_{$class::$title}_priority"] ) ? $settings["sitemap_{$class::$title}_priority"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_PRIORITY ) ) );
|
||||
if ( $priority !== -1 )
|
||||
@@ -172,7 +166,6 @@ class _Images
|
||||
}
|
||||
|
||||
$sitemap->buildSitemapFile( $filename, $entries, $lastId, array( 'image' => 'http://www.google.com/schemas/sitemap-image/1.1' ) );
|
||||
|
||||
return $lastId;
|
||||
}
|
||||
}
|
||||
@@ -156,8 +156,6 @@ class _Videos
|
||||
'video:rating' => $item->mapped('rating_average'),
|
||||
'video:view_count' => $item->mapped('views'),
|
||||
'video:publication_date' => \IPS\DateTime::ts( $item->date )->rfc3339(),
|
||||
'video:category' => \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get( $item->container()->_titleLanguageKey ),
|
||||
'video:gallery_loc' => array( 0 => (string) $item->directContainer()->url(), 'title' => $item->directContainer()->_title ),
|
||||
'video:uploader' => array( 0 => $item->author()->name, 'info' => (string) $item->author()->url() ),
|
||||
);
|
||||
|
||||
@@ -178,7 +176,6 @@ class _Videos
|
||||
}
|
||||
|
||||
$sitemap->buildSitemapFile( $filename, $entries, $lastId, array( 'video' => 'http://www.google.com/schemas/sitemap-video/1.1' ) );
|
||||
|
||||
return $lastId;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user