Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -171,11 +171,6 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
|
||||
if ( $club = $this->club() )
|
||||
{
|
||||
if ( !$member->member_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch ( $permission )
|
||||
{
|
||||
case 'add':
|
||||
@@ -249,7 +244,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
|
||||
if ( $club = $this->club() )
|
||||
{
|
||||
if ( $club->type == $club::TYPE_PUBLIC or $club->type == $club::TYPE_READONLY )
|
||||
if ( $club->type == $club::TYPE_PUBLIC or $club->type == $club::TYPE_READONLY or $club->type == $club::TYPE_OPEN)
|
||||
{
|
||||
return 'ca';
|
||||
}
|
||||
@@ -1221,14 +1216,14 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
{
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
|
||||
$where[] = array( 'blog_club_id IS NOT NULL' );
|
||||
|
||||
if ( $member->modPermission('can_access_all_clubs') )
|
||||
{
|
||||
return static::nodesWithPermission( NULL, $member, $where );
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = array( 'blog_club_id IS NOT NULL' );
|
||||
|
||||
if ( $permissionCheck === 'add' )
|
||||
{
|
||||
$statuses = array( \IPS\Member\Club::STATUS_LEADER, \IPS\Member\Club::STATUS_MODERATOR );
|
||||
@@ -1239,7 +1234,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
}
|
||||
$where[] = array( \IPS\Db::i()->in( 'status', $statuses ) );
|
||||
|
||||
return new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'blog_blogs', $where )->join( 'core_clubs_memberships', array( 'club_id=blog_club_id AND member_id=?', \IPS\Member::loggedIn()->member_id ) ), get_called_class() );
|
||||
return new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'blog_blogs', $where )->join( 'core_clubs_memberships', array( 'club_id=blog_club_id AND member_id=?', $member->member_id ) ), get_called_class() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,6 @@ class _Feed extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
$entry = \IPS\blog\Entry::createItem( \IPS\Member::load( $this->member ), NULL, $article['date'], $container );
|
||||
$entry->name = $article['title'];
|
||||
$entry->content = \IPS\Text\Parser::parseStatic( $article['content'], TRUE );
|
||||
|
||||
if ( $article['link'] )
|
||||
{
|
||||
@@ -107,8 +106,10 @@ class _Feed extends \IPS\Patterns\ActiveRecord
|
||||
}
|
||||
|
||||
$link = htmlspecialchars( $this->import_show_link, ENT_QUOTES | ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
$entry->content .= "<br><p><a href='{$article['link']}' {$linkRelPart}>{$link}</a></p>";
|
||||
$article['content'] .= "<br><p><a href='{$article['link']}' {$linkRelPart}>{$link}</a></p>";
|
||||
}
|
||||
|
||||
$entry->content = \IPS\Text\Parser::parseStatic( $article['content'], TRUE, NULL, \IPS\Member::load( $this->member ) );
|
||||
|
||||
$entry->status = 'published';
|
||||
$entry->save();
|
||||
|
||||
@@ -323,11 +323,11 @@ class _Entry extends \IPS\Content\Item implements
|
||||
$joins[] = array( 'from' => 'core_clubs', 'where' => 'core_clubs.id=blog_blogs.blog_club_id' );
|
||||
if ( $member->member_id )
|
||||
{
|
||||
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR ' . \IPS\Db::i()->in( 'blog_blogs.blog_club_id', $member->clubs() ) . ' OR core_clubs.type=? OR core_clubs.type=? )', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY );
|
||||
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR ' . \IPS\Db::i()->in( 'blog_blogs.blog_club_id', $member->clubs() ) . ' OR core_clubs.type=? OR core_clubs.type=? OR core_clubs.type=?)', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY, \IPS\Member\Club::TYPE_OPEN, );
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR core_clubs.type=? OR core_clubs.type=? )', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY );
|
||||
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR core_clubs.type=? OR core_clubs.type=? OR core_clubs.type=? )', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY, \IPS\Member\Club::TYPE_OPEN, );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -427,14 +427,16 @@ class _Entry extends \IPS\Content\Item implements
|
||||
*/
|
||||
public function processForm( $values )
|
||||
{
|
||||
$new = $this->_new;
|
||||
|
||||
parent::processForm( $values );
|
||||
|
||||
if ( !$this->_new )
|
||||
if ( !$new )
|
||||
{
|
||||
$oldContent = $this->content;
|
||||
}
|
||||
$this->content = $values['blog_entry_content'];
|
||||
if ( !$this->_new )
|
||||
if ( !$new )
|
||||
{
|
||||
$this->sendAfterEditNotifications( $oldContent );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user