Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+44 -3
View File
@@ -245,6 +245,10 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
case 'view':
case 'read':
default:
if( $this->isPublic() )
{
return TRUE;
}
return $club->canRead( $member );
}
}
@@ -1183,7 +1187,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
public function coverPhoto()
{
$photo = parent::coverPhoto();
$photo->overlay = \IPS\Theme::i()->getTemplate( 'view', 'blog' )->coverPhotoOverlay( $this );
$photo->overlay = \IPS\Theme::i()->getTemplate('view', 'blog')->coverPhotoOverlay($this);
return $photo;
}
@@ -1305,7 +1309,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
* @param \IPS\Helpers\Form $form Form object
* @return void
*/
public function clubForm( \IPS\Helpers\Form $form )
public function clubForm( \IPS\Helpers\Form $form, \IPS\Member\Club $club )
{
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_view.js', 'blog', 'front' ) );
@@ -1317,6 +1321,11 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
{
$form->add( new \IPS\Helpers\Form\YesNo( 'blog_enable_rss', $this->id ? $this->settings['allowrss'] : TRUE ) );
}
if( $club->type == 'closed' )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'club_node_public', $this->id ? $this->isPublic() : FALSE ) );
}
/* Categories */
if ( $this->id )
@@ -1432,4 +1441,36 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
{
return $this->last_edate ? \IPS\DateTime::ts( $this->last_edate ) : NULL;
}
}
/**
* @brief The class of the ACP \IPS\Node\Controller that manages this node type
*/
protected static $acpController = "IPS\\calendar\\modules\\admin\\calendars\\calendars";
/**
* Get the URL of the AdminCP page for this node
*
* @param string|NULL $do The "do" query parameter of the url (e.g. 'form', 'permissions', etc).
*
* @return \IPS\Http\Url | NULL
*/
public function acpUrl( $do="form" )
{
try
{
$parentCol = static::$parentNodeColumnId;
$parent = \IPS\blog\Category::load( $this->$parentCol );
$url = parent::acpUrl( $do );
if ( $url !== NULL )
{
$this->_acpUrls[$do] = $url->setQueryString([ 'subnode' => $this->$parentCol ]);
}
}
catch ( \OutOfRangeException $e )
{
$this->_acpUrls[$do] = NULL;
}
return $this->_acpUrls[$do];
}
}
@@ -100,6 +100,11 @@ class _Category extends \IPS\Node\Model
'prefix' => 'categories_',
);
/**
* @brief The class of the ACP \IPS\Node\Controller that manages this node type
*/
protected static $acpController = "IPS\\blog\\modules\\admin\\blogs\\blogs";
/**
* [Node] Add/Edit Form
*
@@ -250,6 +255,11 @@ class _Category extends \IPS\Node\Model
'class' => \get_class( $this ),
);
if ( \IPS\IPS::classUsesTrait( \get_called_class(), 'IPS\Content\ClubContainer' ) AND $this->club() )
{
$return['public'] = ( $this->isPublic() ) ? 1 : 0;
}
return $return;
}
@@ -81,6 +81,11 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
* @brief [Content] Key for hide reasons
*/
public static $hideLogKey = 'blog-entries';
/**
* @brief Whether to track the sentiment scores in cloud_sentiment_scores for this content
*/
public $trackSentimentScore = true;
/**
* Get items with permission check
+9 -3
View File
@@ -155,6 +155,11 @@ class _Entry extends \IPS\Content\Item implements
* @brief Use a default cover photo
*/
public static $coverPhotoDefault = true;
/**
* @brief Whether to track the sentiment scores in cloud_sentiment_scores for this content
*/
public $trackSentimentScore = true;
/**
* Set the title
@@ -450,7 +455,7 @@ class _Entry extends \IPS\Content\Item implements
}
$return['blog_entry_new_category'] = new \IPS\Helpers\Form\Text( 'blog_entry_new_category', NULL, TRUE, array(), NULL, NULL, NULL, "blog_entry_new_category" );
$return['image'] = new \IPS\Helpers\Form\Upload( 'blog_entry_cover_photo', ( ( $item AND $item->cover_photo ) ? \IPS\File::get( 'blog_Entries', $item->cover_photo ) : NULL ), FALSE, array( 'storageExtension' => 'blog_Entries', 'allowStockPhotos' => TRUE, 'image' => array( 'maxWidth' => 4800, 'maxHeight' => 4800 ) ) );
$return['image'] = new \IPS\Helpers\Form\Upload( 'blog_entry_cover_photo', ( ( $item AND $item->cover_photo ) ? \IPS\File::get( 'blog_Entries', $item->cover_photo ) : NULL ), FALSE, array( 'storageExtension' => 'blog_Entries', 'allowStockPhotos' => TRUE, 'image' => array( 'maxWidth' => 4800, 'maxHeight' => 4800 ), 'canBeModerated' => TRUE ) );
$return['publish'] = new \IPS\Helpers\Form\YesNo( 'blog_entry_publish', $item ? $item->status : TRUE, FALSE, array( 'togglesOn' => array( 'blog_entry_date' ) ) );
@@ -496,7 +501,7 @@ class _Entry extends \IPS\Content\Item implements
}
$this->content = $values['blog_entry_content'];
$sendFilterNotifications = $this->checkProfanityFilters( FALSE, $new );
$sendFilterNotifications = $this->checkProfanityFilters( FALSE, !$new, NULL, NULL, 'blog_Entries', $new ? ['blog-entry-' . $this->container()->id] : NULL, $values['blog_entry_cover_photo'] ? [ $values['blog_entry_cover_photo'] ] : [] );
if ( !$new AND $sendFilterNotifications === FALSE )
{
@@ -525,6 +530,7 @@ class _Entry extends \IPS\Content\Item implements
if ( $this->date > time() )
{
$this->status = 'draft';
$this->publish_date = $this->date;
}
if( $values['entry_category_choice'] == 1 and $values['entry_category_id'] )
@@ -962,7 +968,7 @@ class _Entry extends \IPS\Content\Item implements
$attachments[] = array( 'core_Clubs' => $club->cover_photo );
}
return \count( $attachments ) ? $attachments : NULL;
return \count( $attachments ) ? \array_slice( $attachments, 0, $limit ) : NULL;
}
/**